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

☔ Wrap Shapely to reduce common mistakes #1

Open
zerebubuth opened this issue Nov 21, 2017 · 0 comments
Open

☔ Wrap Shapely to reduce common mistakes #1

zerebubuth opened this issue Nov 21, 2017 · 0 comments

Comments

@zerebubuth
Copy link
Member

Following on from a discussion on a raw_tiles issue, we might want to think about wrapping Shapely to avoid common pitfalls when going geometric operations.

For example:

  • We usually think of a polygon-polygon intersection as returning a polygon, but it can also return points or linestrings, or a geometry collection of any/all of those. Wrapping the operation to match our mental processes would result in fewer issues, like these. Alternatively, we could return a tuple of (points, lines, polygons), which would make dealing with the non-polygon bits more explicit.
  • We could convert all empty geometries into None, or an explicit empty geometry type which raises an exception when used in any operation. This would make it easier to enforce checking for emptiness. We almost always want to discard features with empty geometries, and do not want to include them in any output.
@nvkelso nvkelso transferred this issue from another repository Feb 21, 2019
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

No branches or pull requests

1 participant