/ msLoadProjectionStringEPSG */ / Checks fro EPSG type projection and set the axes for a */ certain code ranges. */ Use for now in WMS 1.3.0 */ /
| 1297 | /* Use for now in WMS 1.3.0 */ |
| 1298 | /************************************************************************/ |
| 1299 | int 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 | |
| 1338 | int msLoadProjectionString(projectionObj *p, const char *value) |
no test coverage detected