-
Notifications
You must be signed in to change notification settings - Fork 43
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
Remove rasterio dep on pyproj #1182
Conversation
We could make a dependency on
Really, |
I think geographiclib is C++ with Python wrappings? Either way, I think the goal with this PR should be to reduce dependencies for this operation |
The geographiclib python package seems to be pure python without any lib dependencies, but reducing dependencies is worthwhile in and of itself. We are using pyproj to compute the distance between the corner points and using that to compute the average dimension of a pixel. We could have a simple fall back where if pyproj isn't available, we calculate the great circle distance on a sphere and accept that it could have 0.5% error. |
It's worth trying this to at least see how different the results can be for our testing data. @manthey, is that math something you are familiar with or should I do some research into how to do this? |
@12rambau, do you have any thoughts on depending on |
We put the Vincenty functions directly into geojs, though we probably should have just pulled in a package. They aren't hard, but fussy and not the sort of thing I think we should have since so many other packages implement that. The simple great circle distance on a sphere is just trig (see https://en.wikipedia.org/wiki/Great-circle_distance) to get an angle multiplied by the average radius of the Earth; if we are doing a fallback to avoid a package, that is probably all we want. |
Sounds good and simple enough! Will add to my todo list to do the great circle estimation then see if it skews results too differently |
That was easy! Tests pass for me locally and as far as I can tell (few surface level tests), there isn't any visible impact on tiles or thumbnails |
The biggest difference I see is in sample file test/test_files/rgba_geotiff.tiff, which reports a pixel size of 8.181m rather than 8.170 m. |
oups I'm a bit late to the party. I'm usually depending on the CRS module of rasterio which is sufficient for my applications. It seems a bit more complex from your side but the solution you found is elegant enough. |
Draft work to remove the
rasterio
source module's dependence onpyproj
.Considering how easy it is to install
pyproj
these days, I don't think this is totally necessary but it's probably best to have the rasterio source module userasterio
directly for everything rather than pulling an additional dependency.There is still one remaining function
getPixelSizeInMeters()
that I wasn't immediately sure on how to reproduce withrasterio