Skip to content
Snippets Groups Projects
Commit e00163f2 authored by Jonathan Guinet's avatar Jonathan Guinet
Browse files

ENH: IsESRIValidWKT method is available in GeoInformationConversion.

parent 90d9c381
No related branches found
No related tags found
No related merge requests found
......@@ -18,9 +18,13 @@
#include "otbGeoInformationConversion.h"
#include "ogr_spatialref.h"
#include "ogr_core.h"
#include "cpl_conv.h"
#include "boost/lexical_cast.hpp"
namespace otb
{
......@@ -60,4 +64,11 @@ std::string GeoInformationConversion::ToWKT(const std::string& candidateSrid)
}
}
bool GeoInformationConversion::IsESRIValidWKT(const std::string &wkt)
{
OGRSpatialReference SRS(wkt.c_str());
SRS.morphToESRI();
return SRS.Validate()!=OGRERR_NONE;
}
} // End namespace otb
......@@ -21,6 +21,7 @@
#include <string>
namespace otb
{
......@@ -35,6 +36,9 @@ namespace GeoInformationConversion
/** method used to create a wkt from an epsg number */
std::string ToWKT(int srid);
std::string ToWKT(const std::string& candidateSrid);
/** this method try to morph a wkt to ESRI WKT format and returns the error code**/
bool IsESRIValidWKT(const std::string &Wkt);
}
} // End namespace otb
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment