* \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
| 857 | * This function is the same as OGRSpatialReference::OGRSpatialReference() |
| 858 | */ |
| 859 | OGRSpatialReferenceH 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() */ |
nothing calls this directly
no test coverage detected