Skip to content
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

DOC: update user manual for functions that ~moved from shapely.ops to shapely #2030

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

theroggy
Copy link
Contributor

@theroggy theroggy commented Mar 26, 2024

From shapely 2.0, many functions that were in shapely.ops before, became available directly in the shapely 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:

  • line-like input versus explicit iterables of Linestrings: line oriented functions in shapely.ops support line-like input, but the equivalent functions in shapely don't . I changed the doc to reflect that, but maybe this is not wanted? Relevant functions:
    • shapely.ops.polygonizevsshapely.polygonize`
    • shapely.ops.polygonize_full vs shapely.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.
  • some functions return slightly different results, e.g.:
    • shapely.shortest_line returns a LineString vs shapely.ops.nearest_points returns a Tuple of 2 Points

@theroggy theroggy marked this pull request as draft March 26, 2024 11:32
@theroggy theroggy marked this pull request as ready for review March 26, 2024 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant