Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/gdal/ogr_file_format.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Member

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."

if (linear_geom) {
OGR_F_SetGeometryDirectly(feature.get(), linear_geom);
Copy link
Member

Choose a reason for hiding this comment

The 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);
Copy link
Member

Choose a reason for hiding this comment

The 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?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello Kai,
I think that Mapper is working in 2D only? There are (not exactly in Czech) some base maps in 3D, and I think that Mapper can not import these 3D "polygonZ" features for this reason. I think that there would be some ways to import these features into Mapper. Please check the code that I sent. It is from Gemini, I am not a programmer (-:
Yes, I think that curve geometries and "polygonZ" features are two different problems.
Excuse my amateurism.

importFeature(map_part, feature_definition, feature.get(), geometry, clipping.get());
}
}
Expand Down