From 3e935fb6981e994087287103f245811dd7f4921c Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Thu, 17 Jun 2021 12:42:46 +0200 Subject: [PATCH 1/2] Error msg when geometry is not supported in GeoJSON --- gdal/ogr/ogrsf_frmts/geojson/ogrgeojsonwriter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gdal/ogr/ogrsf_frmts/geojson/ogrgeojsonwriter.cpp b/gdal/ogr/ogrsf_frmts/geojson/ogrgeojsonwriter.cpp index c44adeed5c47..415cb02391a5 100644 --- a/gdal/ogr/ogrsf_frmts/geojson/ogrgeojsonwriter.cpp +++ b/gdal/ogr/ogrsf_frmts/geojson/ogrgeojsonwriter.cpp @@ -1079,9 +1079,9 @@ json_object* OGRGeoJSONWriteGeometry( const OGRGeometry* poGeometry, oOptions ); else { - CPLDebug( "GeoJSON", - "Unsupported geometry type detected. " - "Feature gets NULL geometry assigned." ); + CPLError(CE_Failure, CPLE_NotSupported, + "Unsupported GeoJSON geometry type detected. " + "Feature gets NULL geometry assigned."); } if( poObjGeom != nullptr ) From f201b846d99291d1e892d33316f128b1cda8ecff Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Thu, 17 Jun 2021 14:36:05 +0200 Subject: [PATCH 2/2] Update gdal/ogr/ogrsf_frmts/geojson/ogrgeojsonwriter.cpp Co-authored-by: Even Rouault --- gdal/ogr/ogrsf_frmts/geojson/ogrgeojsonwriter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdal/ogr/ogrsf_frmts/geojson/ogrgeojsonwriter.cpp b/gdal/ogr/ogrsf_frmts/geojson/ogrgeojsonwriter.cpp index 415cb02391a5..366d94a1fb06 100644 --- a/gdal/ogr/ogrsf_frmts/geojson/ogrgeojsonwriter.cpp +++ b/gdal/ogr/ogrsf_frmts/geojson/ogrgeojsonwriter.cpp @@ -1080,7 +1080,7 @@ json_object* OGRGeoJSONWriteGeometry( const OGRGeometry* poGeometry, else { CPLError(CE_Failure, CPLE_NotSupported, - "Unsupported GeoJSON geometry type detected. " + "OGR geometry type unsupported as a GeoJSON geometry detected. " "Feature gets NULL geometry assigned."); }