MCPcopy Index your code
hub / github.com/MapServer/MapServer / msLoadProjectionStringEPSG

Function msLoadProjectionStringEPSG

mapfile.c:1299–1335  ·  view source on GitHub ↗

/ msLoadProjectionStringEPSG */ / Checks fro EPSG type projection and set the axes for a */ certain code ranges. */ Use for now in WMS 1.3.0 */ /

Source from the content-addressed store, hash-verified

1297/* Use for now in WMS 1.3.0 */
1298/************************************************************************/
1299int msLoadProjectionStringEPSG(projectionObj *p, const char *value)
1300{
1301#ifdef USE_PROJ
1302 if(p) msFreeProjection(p);
1303
1304 p->gt.need_geotransform = MS_FALSE;
1305
1306 if (strncasecmp(value, "EPSG:", 5) == 0)
1307 {
1308 size_t buffer_size = 10 + strlen(value+5) + 1;
1309 char *init_string = (char*)msSmallMalloc(buffer_size);
1310
1311 /* translate into PROJ.4 format. */
1312 snprintf(init_string, buffer_size, "init=epsg:%s", value+5 );
1313
1314 p->args = (char**)msSmallMalloc(sizeof(char*) * 2);
1315 p->args[0] = init_string;
1316 p->numargs = 1;
1317
1318
1319 if( msIsAxisInverted(atoi(value+5)))
1320 {
1321 p->args[1] = msStrdup("+epsgaxis=ne");
1322 p->numargs = 2;
1323 }
1324
1325 return msProcessProjection( p );
1326 }
1327
1328 return msLoadProjectionString(p, value);
1329
1330#else
1331 msSetError(MS_PROJERR, "Projection support is not available.",
1332 "msLoadProjectionStringEPSG()");
1333 return(-1);
1334#endif
1335}
1336
1337
1338int msLoadProjectionString(projectionObj *p, const char *value)

Callers 5

FLTParseGMLEnvelopeFunction · 0.85
msOWSPrintBoundingBoxFunction · 0.85
msWMSLoadGetMapParamsFunction · 0.85
msWFSGetFeatureApplySRSFunction · 0.85
msWFSGetFeatureFunction · 0.85

Calls 8

msFreeProjectionFunction · 0.85
strncasecmpFunction · 0.85
msSmallMallocFunction · 0.85
msIsAxisInvertedFunction · 0.85
msStrdupFunction · 0.85
msProcessProjectionFunction · 0.85
msLoadProjectionStringFunction · 0.85
msSetErrorFunction · 0.85

Tested by

no test coverage detected