Skip to content

Commit

Permalink
try object syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsumner committed Jun 6, 2024
1 parent 2d5af08 commit 7ed0488
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions inst/include/gdallibrary/gdallibrary.h
Original file line number Diff line number Diff line change
Expand Up @@ -658,14 +658,14 @@ inline List gdal_read_geometry(CharacterVector dsn,


inline CharacterVector gdal_proj_to_wkt(CharacterVector proj_str) {
OGRSpatialReference *oSRS = nullptr;
oSRS = new OGRSpatialReference;
OGRSpatialReference oSRS;
//oSRS = new OGRSpatialReference;
char *pszWKT = NULL;
oSRS->SetFromUserInput(proj_str[0]);
oSRS->exportToWkt(&pszWKT);
oSRS.SetFromUserInput(proj_str[0]);
oSRS.exportToWkt(&pszWKT);
CharacterVector out = Rcpp::CharacterVector::create(pszWKT);
CPLFree(pszWKT);
if (oSRS != nullptr) delete oSRS;
//if (oSRS != nullptr) delete oSRS;
return out;
}

Expand Down

0 comments on commit 7ed0488

Please sign in to comment.