-
Notifications
You must be signed in to change notification settings - Fork 601
Add geoms property to BaseGeometry #1965
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
base: main
Are you sure you want to change the base?
Conversation
failing tests on seem to be tied to using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cookiedan42 sorry for the delay in review! I have a suggestion that should unblock this work.
shapely/geometry/base.py
Outdated
|
||
@property | ||
def geoms(self): | ||
return GeometrySequence(self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cookiedan42 here's what I suggest to solve the recursion issue. Do the following for the base class:
return GeometrySequence(self) | |
raise NotImplementedError |
And then for single-part Point
, etc, classes, do this:
@property
def geoms(self):
return [self]
GeometrySequence
is nothing more than a Python sequence protocol backed by a GEOS multi-part geometry, but as you notice, introduces some complication.
@cookiedan42 I enabled the workflow. There are some linting issues and also this change really causes trouble for |
Added geoms property to BaseGeometry
Added tests for Simple Geometries to test .geom method
Resolves #1881