Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap gdal warp in a general method #68

Closed
rafaqz opened this issue Oct 1, 2020 · 2 comments · Fixed by #73
Closed

Wrap gdal warp in a general method #68

rafaqz opened this issue Oct 1, 2020 · 2 comments · Fixed by #73

Comments

@rafaqz
Copy link
Owner

rafaqz commented Oct 1, 2020

https://discourse.julialang.org/t/help-request-using-archgdal-gdalwarp-for-resampling-a-raster-dataset/47039

@vlandau have a go if you like, ping me with any help you need.

Checkout https://github.com/JuliaGeo/GeoFormatTypes.jl for how crs is wrapped as passed to ArchGDAL.

We could maybe just reuse the existing reproject method? But applied to the array so it will reproject both the data and the dim. Not sure if that's the clearest. The gdalwarp docs say it does "mosaicing, reprojecting and warping".

There are already methods to reproject the dimensions here https://github.com/rafaqz/GeoData.jl/blob/master/src/reproject.jl

@vlandau
Copy link
Collaborator

vlandau commented Oct 1, 2020

Thinking about the parameters we would need -- we could do something simple like:

  • input raster (a GeoArray?)

And:

  • output CRS (or wkt)
  • output resolution
    OR
  • snap raster (and output crs and resolution can be grabbed from it). Pixels in the output raster will line be aligned with those in the snap raster. This will come in handy if you need to do raster algebra with layers that don't line up perfectly.

So maybe two methods? resample(input::GeoArray, crs::CRS, resolution::Number) and resample(input::GeoArray, snap_raster::GeoArray)

@rafaqz
Copy link
Owner Author

rafaqz commented Oct 2, 2020

That sounds pretty spot on to me. Passing in another GeoArray to snap to would be really slick. resample is a good method name too.

If crs is a GeoFormatTypes.jl wrapper you don't have to know if it's wkt or proj etc they will just work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants