Skip to content

Commit

Permalink
cast argument to char** properly for MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
nwagenbrenner committed Jan 24, 2024
1 parent 13f5d8a commit 7171877
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/ninja/readInputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ void ninja::readInputFile()
{
GDALDataset *poDataset;

std::string GDALDriverName, GDALDriverLongName, GDALProjRef;
std::string GDALDriverName, GDALDriverLongName;
const char *pszPrj;

std::string ext;

Expand All @@ -70,17 +71,17 @@ void ninja::readInputFile()
//check for the prj info...
if(poDataset->GetProjectionRef() != NULL)
{
GDALProjRef = poDataset->GetProjectionRef();
pszPrj = (char*)poDataset->GetProjectionRef();

//ESRI and OGC WKT are not always identical. Convert the projection string to ESRI WKT to ensure proper opening of
//our output products in ESRI systems. ESRI WKT should be handled by most other GIS systems as well.
OGRSpatialReference spatial_ref;
char* esri_wkt;
spatial_ref.importFromWkt((char**)GDALProjRef.c_str());
char* pszPrjEsri;
spatial_ref.importFromWkt(&pszPrj);
spatial_ref.morphToESRI();
spatial_ref.exportToWkt(&esri_wkt);
spatial_ref.exportToWkt(&pszPrjEsri);

input.dem.set_prjString(esri_wkt);
input.dem.set_prjString(pszPrjEsri);
}

if (GDALDriverName == "LCP")
Expand Down

0 comments on commit 7171877

Please sign in to comment.