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

Function msGetQueryResultBounds

mapquery.c:1905–1930  ·  view source on GitHub ↗

msGetQueryResultBounds() * * Compute the BBOX of all query results, returns the number of layers found * that contained query results and were included in the BBOX. * i.e. if we return 0 then the value in bounds is invalid. */

Source from the content-addressed store, hash-verified

1903 * i.e. if we return 0 then the value in bounds is invalid.
1904 */
1905int msGetQueryResultBounds(mapObj *map, rectObj *bounds)
1906{
1907 int i, found=0;
1908 rectObj tmpBounds;
1909
1910 for(i=0; i<map->numlayers; i++) {
1911
1912 layerObj *lp;
1913 lp = (GET_LAYER(map, i));
1914
1915 if(!lp->resultcache) continue;
1916 if(lp->resultcache->numresults <= 0) continue;
1917
1918 tmpBounds = lp->resultcache->bounds;
1919
1920 if(found == 0) {
1921 *bounds = tmpBounds;
1922 } else {
1923 msMergeRect(bounds, &tmpBounds);
1924 }
1925
1926 found++;
1927 }
1928
1929 return found;
1930}
1931
1932/* TODO: Rename this msFreeResultSet() or something along those lines... */
1933/* msQueryFree()

Callers 2

setExtentFromShapesFunction · 0.85
msGMLWriteWFSQueryFunction · 0.85

Calls 1

msMergeRectFunction · 0.85

Tested by

no test coverage detected