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

Getting geometry of raster file #129

Open
maxott opened this issue Jun 27, 2020 · 1 comment
Open

Getting geometry of raster file #129

maxott opened this issue Jun 27, 2020 · 1 comment
Milestone

Comments

@maxott
Copy link

maxott commented Jun 27, 2020

Most likely a newbie question but how can I get the geometry or boundary of a geotiff file?

@visr
Copy link
Collaborator

visr commented Jun 29, 2020

What would you like the result to look like. Is this sufficient?

using ArchGDAL
const AG = ArchGDAL

p = raw"c:\Users\visser_mn\.julia\dev\ArchGDAL\test\data\utmsmall.tif"
ds = AG.read(p)

geotransform = AG.getgeotransform(ds)
xmin = geotransform[1]
ymax = geotransform[4]
xmax = xmin + geotransform[2] * AG.width(ds)
ymin = ymax + geotransform[6] * AG.height(ds)

Although I think in GeoArrays.jl it is done a bit more properly, by converting this to an AffineMap from CoordinateTransformations.jl. I think that should handle rotation as well, if needed.

Perhaps something similar would be good to add here as well, as I imagine this is a common use case.

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

No branches or pull requests

3 participants