DOC: update user manual for functions that ~moved from shapely.ops to shapely #2030
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
From shapely 2.0, many functions that were in
shapely.ops
before, became available directly in theshapely
namespace, I suppose in the spirit of Flat is better than nested. Some functions were also renamed to be more consistent with GEOS/PostGIS.However, the user manual wasn't updated to reflect this. This PR tries to incorporate these changes.
I expected this to be a mainly cosmetic change, but while making the changes I encountered many more differences between the functions than I was expecting, so to be discussed how to deal with this:
shapely.ops
support line-like input, but the equivalent functions inshapely
don't . I changed the doc to reflect that, but maybe this is not wanted? Relevant functions:vs
shapely.polygonize`shapely.ops.polygonize_full
vsshapely.polygonize_full
shapely.line_merge
is a vectorized function and expects a (arraylike of) MultiLineStrings as input. Hence, many merge operations can be done in one call.shapely.ops.linemerge
expects an iterable of line-line elements as input, and will merge those, so only one merge operation can be done per call.shapely.shortest_line
returns a LineString vsshapely.ops.nearest_points
returns a Tuple of 2 Points