Add classes for curved geometry types#1046
Merged
dbaston merged 10 commits intolibgeos:mainfrom Apr 30, 2024
Merged
Conversation
Member
|
Looks like you have a winner, @dbaston |
|
a little helper for myself: classDiagram
class GeometryCollection
class LineString
class SimpleCurve
class Curve
class Polygon
class Surface
class CircularString
class CompoundCurve
class CurvePolygon
class MultiCurve
class MultiSurface
SimpleCurve <|-- LineString
Curve <|-- SimpleCurve
Surface <|-- Polygon
SimpleCurve <|-- CircularString
Curve <|-- CompoundCurve
Surface <|-- CurvePolygon
GeometryCollection <|-- MultiCurve
GeometryCollection <|-- MultiSurface
|
|
From QGIS side, I don't expect any troubles from the difference, most code works on geometry level (and not individual geos class level), we this is pretty transparent. @nyalldawson @lbartoletti @elpaso (as last contributors there) do you see any potential problem? |
lbartoletti
reviewed
Feb 28, 2024
Contributor
No, looks ok to me. Glad to have curve support in GEOS! kudos @dbaston |
c85565c to
9d77ade
Compare
Contributor
|
Perhaps mark this as Draft? |
f30a751 to
e7eb5a2
Compare
Member
Author
|
I think this is ready for review. While large, I think it represents the minimum set of changes that can safely go into master:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds curved geometry types to the GEOS
Geometryhierarchy and adds support to theWKTReaderfor reading them. It is not ready to be merged; I'm just posting it at this stage in case anyone has feedback on the class hierarchy before I continue with implementation.It makes the following additions to the class hierarchy:
SimpleCurvetoLineString.CurvetoSimpleCurve.SurfacetoPolygon.CircularStringwithSimpleCurveas a parentCompoundCurvewithCurveas a parentCurvePolygonwithSurfaceas a parentMultiCurvewithGeometryCollectionas a parentMultiSurfacewithGeometryCollectionas a parentIt turns out this is pretty close to what OGR does, except that OGR does
Surface-->CurvePolygon-->Polygoninstead of having bothCurvePolygonandPolygonas children ofSurface. While it is true that aPolygonis a specialization of aCurvePolygon, settingCurvePolygonas the parent has a downside of making the result ofdynamic_cast<CurvePolygon*>less informative, and I didn't see an upside that would outweigh this annoyance. Similarly, I did not makeMultiPolygona subclass ofMultiSurface, orMultiLineStringa subclass ofMultiCurve. But I'm receptive to the argument that it's simpler to just do things the same as OGR.The QGIS class hierarchy looks to be the same as OGR's, except for the omission of
SimpleCurve.