From 971d915ab7a5caab35a70f5ea7e22a8ebad4c801 Mon Sep 17 00:00:00 2001 From: jirivis Date: Mon, 5 Jan 2026 11:56:15 +0100 Subject: [PATCH] Fix: Flatten OGR curve geometries to polygons before import --- src/gdal/ogr_file_format.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gdal/ogr_file_format.cpp b/src/gdal/ogr_file_format.cpp index e84ef9ec3..3afcba06a 100644 --- a/src/gdal/ogr_file_format.cpp +++ b/src/gdal/ogr_file_format.cpp @@ -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); + geometry = linear_geom; + } + } + + OGR_G_FlattenTo2D(geometry); importFeature(map_part, feature_definition, feature.get(), geometry, clipping.get()); } }