-
Notifications
You must be signed in to change notification settings - Fork 127
Fix: Flatten OGR curve geometries (CurvePolygon) to polygons before import #2460
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: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1059,7 +1059,16 @@ void OgrFileImport::importLayer(MapPart* map_part, OGRLayerH layer) | |
| ++empty_geometries; | ||
| continue; | ||
| } | ||
|
|
||
|
|
||
| if (OGR_G_HasCurveGeometry(geometry, 1)) { | ||
| OGRGeometryH linear_geom = OGR_G_GetLinearGeometry(geometry, 0, nullptr); | ||
| if (linear_geom) { | ||
| OGR_F_SetGeometryDirectly(feature.get(), linear_geom); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "this function assumes ownership of the passed geometry" ✔️ |
||
| geometry = linear_geom; | ||
| } | ||
| } | ||
|
|
||
| OGR_G_FlattenTo2D(geometry); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IIUC this is not directly related to curve geometries: "converts all Z coordinates to 0.0." Is there an actual benefit from this operation for further processing in Mapper?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hello Kai, |
||
| importFeature(map_part, feature_definition, feature.get(), geometry, clipping.get()); | ||
| } | ||
| } | ||
|
|
||
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.
"The ownership of the returned geometry belongs to the caller."