Closed benbovy closed 1 month ago
Patch coverage: 40.24
% and project coverage change: -6.20
:warning:
Comparison is base (
e874e60
) 56.07% compared to head (c516f38
) 49.88%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Maybe something to also discuss more generally: do we want / need all those subclasses?
Maybe something to also discuss more generally: do we want / need all those subclasses?
Do you mean that alternatively we could expose only one Geography
class (with a geometry type property) along with top-level creation functions for each kind of geometry?
I see two advantages of having subclasses:
One argument against subclasses is that it is a bit more code to maintain (maybe some duplicate logic here and there), but that's not much in my opinion.
Another alternative would be to expose a unique class for Point
vs. MultiPoint
, LineString
vs. MultiLineString
, etc. like in s2geography.
std::vector
), especially for trivial functions applied to large arrays of single features (a rather common use case?). I have no idea, though, maybe splitting the classes in s2geography would be premature optimization.@jorisvandenbossche I'm moving forward with the implementation of the Geography subclasses here but this shouldn't prevent us from discussing how best to expose these (maybe in a separate issue?). I wouldn't mind refactoring things if needed.
I haven't checked if shapely copies the input geometries when creating a collection... Here that's a requirement if we want to reuse s2geography::GeographyCollection
(which owns its features).
I added a clone
method to the spherely wrapper classes which makes it easier. I think it would make things even easier if this method was available in the s2geography classes as well.
There are a few other things that we would need to port into the s2geography classes (also address #27) before we can get rid of spherely's wrapper classes (which I'd be very happy to see!). I'll wait a bit more before opening an issue in the s2geography repository with a clear and detailed proposal.
Closing. Superseded by #51.
LinearRing
S2LaxClosedPolylineShape
(+S2Region
implementation copied fromS2Polyline
). I added here some code that we might consider moving to s2geography later if it's worth it.Polygon
MultiPoint
MultiLineString
MultiPolygon
GeometryCollection
Also:
Let's save the following for later: