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

Add readgeotiff util function? #88

Closed
juliohm opened this issue Aug 25, 2019 · 4 comments
Closed

Add readgeotiff util function? #88

juliohm opened this issue Aug 25, 2019 · 4 comments

Comments

@juliohm
Copy link

juliohm commented Aug 25, 2019

What do you think of a utility function to read bands from geo tiff files?

using ArchGDAL

function readgeotiff(fname, bands=1)
    ArchGDAL.registerdrivers() do
        ArchGDAL.read(fname) do dataset
            ArchGDAL.read(dataset, bands)
        end
    end
end

I am using it all the time, maybe it could be part of ArchGDAL.jl?

@evetion
Copy link
Collaborator

evetion commented Aug 25, 2019

Over in #76 it will become easier (reduce the do to do the above.) Note that your utility is not specific to geotiffs and will happily read any supported driver into the first band.

Shameless plug, you can have a try with my own package GeoArrays.jl which has a similar aim as your utility function.

@juliohm
Copy link
Author

juliohm commented Aug 25, 2019

Wasn't aware of GeoArrays.jl @evetion , thanks for sharing. Will take a look now, it seems very useful. One thing I realised with the function above is that the crs is not taken into account, and the coordinates I get are rotated when I load with ArchGDAL.jl. I am probably missing some post-processing step after loading to fix the coordinate system.

@juliohm
Copy link
Author

juliohm commented Aug 25, 2019

Closing the issue for now.

@juliohm juliohm closed this as completed Aug 25, 2019
@yeesian
Copy link
Owner

yeesian commented Aug 26, 2019

One thing I realised with the function above is that the crs is not taken into account, and the coordinates I get are rotated when I load with ArchGDAL.jl. I am probably missing some post-processing step after loading to fix the coordinate system.

Yeah sorry about that. I'm not sure how much it'll help, but we have a branch for reading rasters into something compatible with JuliaImages: e3eaa0f, which I had been putting off until #76 is done. Along the way, we decided GeoRasters is probably the better place/package to figure out how it should 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

No branches or pull requests

3 participants