** msOWSPrintLatLonBoundingBox() ** ** Print a LatLonBoundingBox tag for WMS, or LatLongBoundingBox for WFS ** ... yes, the tag name differs between WMS and WFS, yuck! ** */
| 1414 | ** |
| 1415 | */ |
| 1416 | void msOWSPrintLatLonBoundingBox(FILE *stream, const char *tabspace, |
| 1417 | rectObj *extent, projectionObj *srcproj, |
| 1418 | projectionObj *wfsproj, int nService) |
| 1419 | { |
| 1420 | const char *pszTag = "LatLonBoundingBox"; /* The default for WMS */ |
| 1421 | rectObj ext; |
| 1422 | |
| 1423 | ext = *extent; |
| 1424 | |
| 1425 | if (nService == OWS_WMS) { /* always project to lat long */ |
| 1426 | if (srcproj->numargs > 0 && !pj_is_latlong(srcproj->proj)) { |
| 1427 | projectionObj wgs84; |
| 1428 | msInitProjection(&wgs84); |
| 1429 | msLoadProjectionString(&wgs84, "+proj=longlat +datum=WGS84"); |
| 1430 | msProjectRect(srcproj, &wgs84, &ext); |
| 1431 | msFreeProjection(&wgs84); |
| 1432 | } |
| 1433 | } |
| 1434 | |
| 1435 | if (nService == OWS_WFS) { |
| 1436 | pszTag = "LatLongBoundingBox"; |
| 1437 | if (wfsproj) { |
| 1438 | if (msProjectionsDiffer(srcproj, wfsproj) == MS_TRUE) |
| 1439 | msProjectRect(srcproj, wfsproj, &ext); |
| 1440 | } |
| 1441 | } |
| 1442 | |
| 1443 | msIO_fprintf(stream, "%s<%s minx=\"%g\" miny=\"%g\" maxx=\"%g\" maxy=\"%g\" />\n", |
| 1444 | tabspace, pszTag, ext.minx, ext.miny, ext.maxx, ext.maxy); |
| 1445 | } |
| 1446 | |
| 1447 | /* |
| 1448 | ** Emit a bounding box if we can find projection information. |
no test coverage detected