-
Notifications
You must be signed in to change notification settings - Fork 94
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 utility function for converting geotiffs to area definitions #92
Comments
Hi @djhoese I'm on it. |
We already have it, although it needs also the CRS object from |
@drnextgis Sounds good. I think you could borrow the logic that @pnuu links to, but I'd still like this type of utility in pyresample itself. Some of the logic for this will overlap with what is being done in #138 but that's ok since that PR isn't ready quite yet. I'm assuming you are trying to get hacktoberfest PRs? I think the utility function should accept either a filename, a gdal object, or a rasterio object. If a filename is specified then import rasterio and open it. Then it will do whatever calculations are necessary to generate an AreaDefinition. |
Yes I found this issue by |
I start to work on this issue. In example provided by @pnuu the rotation of source raster is not taken into account. But I have questions about this. For example rasterio's
What is the right approach? |
@drnextgis Do you have an example? |
Example of rotated raster? |
Sorry, I misunderstood your question. The
So I guess you could calculate that from the affine rotation. I don't use a lot of rotated area definitions so I can speak on the best way to do this. @mraspaud or @pnuu or @loreclem may have other opinions. |
I've made a PR, please take a look. |
Users some time want to get an area definition for a geotiff file. This isn't a difficult thing to do necessarily, but is easy to get wrong. @loerum has already added this type of functionality to mipp for reading SARS data, but it could likely be rewritten or made more flexible: https://github.com/pytroll/mipp/blob/master/mipp/read_geotiff.py
I think if the function just takes a gdal object
gdal.Open(fn)
and uses the GDAL API for getting the projection information it may work for more than just geotiff.The text was updated successfully, but these errors were encountered: