MCPcopy Create free account
hub / github.com/OSGeo/gdal / CPL_STDCALL OSRNewSpatialReference

Function CPL_STDCALL OSRNewSpatialReference

ogr/ogrspatialreference.cpp:859–874  ·  view source on GitHub ↗

* \brief Constructor. * * Starting with GDAL 3.0, coordinates associated with a OGRSpatialReference * object are assumed to be in the order of the axis of the CRS definition * (which for example means latitude first, longitude second for geographic CRS * belonging to the EPSG authority). It is possible to define a data axis to CRS * axis mapping strategy with the SetAxisMappingStrategy() met

Source from the content-addressed store, hash-verified

857 * This function is the same as OGRSpatialReference::OGRSpatialReference()
858 */
859OGRSpatialReferenceH CPL_STDCALL OSRNewSpatialReference(const char *pszWKT)
860
861{
862 OGRSpatialReference *poSRS = new OGRSpatialReference();
863
864 if (pszWKT != nullptr && strlen(pszWKT) > 0)
865 {
866 if (poSRS->importFromWkt(pszWKT) != OGRERR_NONE)
867 {
868 delete poSRS;
869 poSRS = nullptr;
870 }
871 }
872
873 return ToHandle(poSRS);
874}
875
876/************************************************************************/
877/* OGRSpatialReference() */

Callers

nothing calls this directly

Calls 2

ToHandleFunction · 0.70
importFromWktMethod · 0.45

Tested by

no test coverage detected