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

Function msProcessProjection

mapfile.c:1185–1229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1183#endif /* USE_PROJ */
1184
1185int msProcessProjection(projectionObj *p)
1186{
1187#ifdef USE_PROJ
1188 assert( p->proj == NULL );
1189
1190 if( strcasecmp(p->args[0],"GEOGRAPHIC") == 0 ) {
1191 msSetError(MS_PROJERR,
1192 "PROJECTION 'GEOGRAPHIC' no longer supported.\n"
1193 "Provide explicit definition.\n"
1194 "ie. proj=latlong\n"
1195 " ellps=clrk66\n",
1196 "msProcessProjection()");
1197 return(-1);
1198 }
1199
1200 if (strcasecmp(p->args[0], "AUTO") == 0) {
1201 p->proj = NULL;
1202 return 0;
1203 }
1204
1205 if (strncasecmp(p->args[0], "AUTO:", 5) == 0 ||
1206 strncasecmp(p->args[0], "AUTO2:", 6) == 0)
1207 {
1208 /* WMS/WFS AUTO projection: "AUTO:proj_id,units_id,lon0,lat0" */
1209 /*WMS 1.3.0: AUTO2:auto_crs_id,factor,lon0,lat0*/
1210 return _msProcessAutoProjection(p);
1211 }
1212 msAcquireLock( TLOCK_PROJ );
1213 if( !(p->proj = pj_init(p->numargs, p->args)) ) {
1214 int *pj_errno_ref = pj_get_errno_ref();
1215 msReleaseLock( TLOCK_PROJ );
1216 msSetError(MS_PROJERR, pj_strerrno(*pj_errno_ref),
1217 "msProcessProjection()");
1218 return(-1);
1219 }
1220
1221 msReleaseLock( TLOCK_PROJ );
1222
1223 return(0);
1224#else
1225 msSetError(MS_PROJERR, "Projection support is not available.",
1226 "msProcessProjection()");
1227 return(-1);
1228#endif
1229}
1230
1231static int loadProjection(projectionObj *p)
1232{

Callers 6

msCopyProjectionFunction · 0.85
loadProjectionFunction · 0.85
msLoadProjectionStringFunction · 0.85
initMapFunction · 0.85
msLoadMapContextGeneralFunction · 0.85

Calls 6

strcasecmpFunction · 0.85
msSetErrorFunction · 0.85
strncasecmpFunction · 0.85
_msProcessAutoProjectionFunction · 0.85
msAcquireLockFunction · 0.85
msReleaseLockFunction · 0.85

Tested by

no test coverage detected