Skip to content

Commit

Permalink
gdal_contour: fix bad coordinate order when outputing from raster wit…
Browse files Browse the repository at this point in the history
…h geographic CRS to KML driver (fixes OSGeo#3757)
  • Loading branch information
rouault committed Apr 29, 2021
1 parent 12469d3 commit a6fdacd
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions gdal/apps/gdal_contour.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,7 @@ MAIN_START(argc, argv)
/* -------------------------------------------------------------------- */
/* Try to get a coordinate system from the raster. */
/* -------------------------------------------------------------------- */
OGRSpatialReferenceH hSRS = nullptr;

const char *pszWKT = GDALGetProjectionRef( hSrcDS );

if( pszWKT != nullptr && strlen(pszWKT) != 0 )
hSRS = OSRNewSpatialReference( pszWKT );
OGRSpatialReferenceH hSRS = GDALGetSpatialRef( hSrcDS );

/* -------------------------------------------------------------------- */
/* Create the output file. */
Expand Down Expand Up @@ -471,14 +466,11 @@ MAIN_START(argc, argv)
}

CPLErr eErr = GDALContourGenerateEx( hBand, hLayer, options, pfnProgress, nullptr );

CSLDestroy( options );
OGR_DS_Destroy( hDS );
GDALClose( hSrcDS );

if (hSRS)
OSRDestroySpatialReference( hSRS );

CSLDestroy( argv );
CSLDestroy( papszDSCO );
CSLDestroy( papszLCO );
Expand Down

0 comments on commit a6fdacd

Please sign in to comment.