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

Function msOWSPrintLatLonBoundingBox

mapows.c:1416–1445  ·  view source on GitHub ↗

** msOWSPrintLatLonBoundingBox() ** ** Print a LatLonBoundingBox tag for WMS, or LatLongBoundingBox for WFS ** ... yes, the tag name differs between WMS and WFS, yuck! ** */

Source from the content-addressed store, hash-verified

1414**
1415*/
1416void 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.

Callers 3

msDumpLayerFunction · 0.85
msWMSGetCapabilitiesFunction · 0.85
msWFSDumpLayerFunction · 0.85

Calls 6

msInitProjectionFunction · 0.85
msLoadProjectionStringFunction · 0.85
msProjectRectFunction · 0.85
msFreeProjectionFunction · 0.85
msProjectionsDifferFunction · 0.85
msIO_fprintfFunction · 0.85

Tested by

no test coverage detected