| 1183 | #endif /* USE_PROJ */ |
| 1184 | |
| 1185 | int 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 | |
| 1231 | static int loadProjection(projectionObj *p) |
| 1232 | { |
no test coverage detected