-
Notifications
You must be signed in to change notification settings - Fork 901
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
ENH: expose all shapely functions as GeoSeries/GeometryArray methods #2010
Comments
About the API design problem. Would these pygeos methods be GeoSeries/GeometryArray's methods or gather them into accessors (after #1952 is done)? Use coordinate ops as the example:
|
I imagined methods. It is shorter and there's surely no overlap in naming as pygeos exposes all as top-level functions. And it is consistent with the existing methods. Do you think that there are some significant benefits of preferring accessors? |
Hello @martinfleis, I believe for implementing the measurements such as Frechet, Hausdorff distance, and so on, we would have to consider the combinations of the different trajectories formed by the edges of the polygons of the GeoSeries elements or is straight-up between two shapely objects? |
@bitanb1999 No, it is a distance between two geometries. See the pygeos API. We need to turn this API: pygeos.hausdorff_distance(a, b, densify=None, **kwargs) To this API: geopandas.GeoSeries.hausdorff_distance(b, densify=None) It is just about exposing those functions as they are as |
@martinfleis Thank you for the clarification! That indeed seems pretty straightforward! Is this issue up for the GSoC 2022? |
Probably not, the small-size GSoC project is 175 hours. Implementing all listed above will be a matter of <10 hours. Have a look at GSoC project ideas here https://github.com/geopandas/geopandas/wiki/Google-Summer-of-Code-2022 to get a sense of scale. Or pick one of them directly :). |
Oh okay! Thank you! |
Another question: Is it possible to integrate GEE with GeoPandas for heavy research-based visualisations? |
I think that |
Yes, the question was associated with the GSoC ideas. Thank you for answering! |
@bitanb1999 If you want to have a chat about GSoC ideas, feel free to move it to out gitter https://gitter.im/geopandas/geopandas. Happy to have a discussion there! |
Do you still think this estimate is accurate? It would be very nice to have all those functions exposed, and if this could be a potential GSoC project, the time to start thinking about that is around now. |
No, given the number and variety of shapely functions not exposed, it will be significantly longer with proper tests and documentation. Some are easy but a lot is not and we'll need to figure out how to seamlessly implement them here. We're usually doing GSoC under the NumFOCUS umbrella so there's a bit more time for us. |
I'm very keen to get the precision functions from shapely2/pygeos in. If someone can point me to the best place to put them, I am happy to have a go at a PR. Ideally, I'd like to have an API like gdf = gpd.GeoDataFrame(...) # maybe an optional ctr param?
gdf.set_precision(...) # with and without inplace One thing I would really like is to be able to (de)serialize this via files like geoparquet, but I suspect that is asking way too much, or at least can be split into a distinct issue :-) |
Historical reasons. GeoPandas API predates accessor API as far as I remember. It would make more sense if the original object was still a |
I would love to be able to use |
@EwoutH feel free to come up with a PR for that. Otherwise I'll tackle it before 1.0 is out for sure. |
|
|
shapely
now contains some functions which could be exposed as methods on GeoSeries/GeometryArray levels.Probably incomplete list of candidates (updated Feb 13, 2023):
set_precision
andget_precision
methods #3175set_precision
andget_precision
methods #3175oriented_envelopeENH: Added minimum_rotated_rectangle from shapely #2541destroy_prepared(don't expose)from_geojson(duplication)from_ragged_array(too low level)is_prepared(don't expose)nodeENH: add node as a GeoSeries method #2925prepare(don't expose)set_coordinates(don't expose)to_geojson(duplication)to_ragged_array(too low level)contains_xyENH: add contains_xy and intersects_xy methods #3114intersects_xyENH: add contains_xy and intersects_xy methods #3114get_dimensions(ignore due to overlap withhas_z
)get_num_points(ignore due to overlap withcount_coordinates
)From upcoming Shapely 2.1
The text was updated successfully, but these errors were encountered: