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

Function msOWSGetLayerExtent

mapows.c:1651–1680  ·  view source on GitHub ↗

** msOWSGetLayerExtent() ** ** Try to establish layer extent, first looking for "ows_extent" metadata, and ** if not found then call msLayerGetExtent() which will lookup the ** layer->extent member, and if not found will open layer to read extent. ** */

Source from the content-addressed store, hash-verified

1649**
1650*/
1651int msOWSGetLayerExtent(mapObj *map, layerObj *lp, const char *namespaces, rectObj *ext)
1652{
1653 const char *value;
1654
1655 if ((value = msOWSLookupMetadata(&(lp->metadata), namespaces, "extent")) != NULL)
1656 {
1657 char **tokens;
1658 int n;
1659
1660 tokens = msStringSplit(value, ' ', &n);
1661 if (tokens==NULL || n != 4) {
1662 msSetError(MS_WMSERR, "Wrong number of arguments for EXTENT metadata.",
1663 "msOWSGetLayerExtent()");
1664 return MS_FAILURE;
1665 }
1666 ext->minx = atof(tokens[0]);
1667 ext->miny = atof(tokens[1]);
1668 ext->maxx = atof(tokens[2]);
1669 ext->maxy = atof(tokens[3]);
1670
1671 msFreeCharArray(tokens, n);
1672 return MS_SUCCESS;
1673 }
1674 else
1675 {
1676 return msLayerGetExtent(lp, ext);
1677 }
1678
1679 return MS_FAILURE;
1680}
1681
1682
1683/**********************************************************************

Callers 8

msBuildWMSLayerURLFunction · 0.85
msWCSGetCoverageMetadataFunction · 0.85
msWFSDumpLayer11Function · 0.85
msDumpLayerFunction · 0.85
msGetGDALGeoTransformFunction · 0.85
msWFSDumpLayerFunction · 0.85
msWFSGetFeatureFunction · 0.85

Calls 5

msOWSLookupMetadataFunction · 0.85
msStringSplitFunction · 0.85
msSetErrorFunction · 0.85
msFreeCharArrayFunction · 0.85
msLayerGetExtentFunction · 0.85

Tested by

no test coverage detected