-
Notifications
You must be signed in to change notification settings - Fork 26
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
warn for indices that expect certain projections #96
Comments
Hm.. I'm not sure if I follow... this expectation is due to the usage of
BTW, I think that we can improve these distances with the proper projections and so on... working with geodesic distance or something like this! |
a ‘metric’ argument might be useful... that’d let you specify the right metric, and use haversine if the coordinates are in lat/lng |
I was thinking about something like this. Would you have some example somewhere that I could draw inspiration from? :) |
This would be a good ref. https://github.com/scipy/scipy/blob/v1.3.0/scipy/spatial/distance.py#L1736 I'd do |
Thanks! Ok, but what about the above |
…d metrics This address pysal#96 ps.: it also makes a small tweak on formating of spatial proximity profile
na its good, the meters means its already projected into a plane |
So, just for registration, the first example using the old only euclidean based measures was returning zero because of the magnitudes of the number of the albers equal projection. These are the centroids number: which leads to these numbers after:
Since DistanceDecayExposure uses |
Ok, after discussing here with @knaaptime , things got clearer for me. So, actually using the haversine distance with albers projection is not correct since this crs is already projected to a planar plane. So, what we could do in this case is: if any problem due to the magnitude of the number occurs and generates nan in that distance matrix, raise a ValueError to the user. Besides that, assuming that we'd like to help our users to use these functions, we need to create a bunch of specific tests using the .crs attribute of the input data. The idea is: if we "suspect" that the user is working with spherical coordinates, raise a warning saying: "It seems like you're working with unprojected coordinate system. Therefore, we recommend to set |
…o be handle (just like the first example of pysal#96 (comment))
So, this is partially solved due to #100. However, I still think that a set of tests/conditions for the input of the GeoPandas to let the user aware of it would be useful. However, now the user can choose between |
with the new pyproj integrated into geopandas, it should be much easier to create checks for CRS versions. Re-upping this thread to remind myself to revisit and rewrite those checks |
this is breaking, e.g. |
geopandas has better CRS handling now (warnings for mismatches and warning when using distance with geometric proj) so closing this here |
DistanceDecayExposure for example, expects wgs84. We decided against implicit reprojection, but we could do a check and raise a warning if we cant determine the crs is wgs84
The text was updated successfully, but these errors were encountered: