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

Function msLayerGetExtent

maplayer.c:281–312  ·  view source on GitHub ↗

** Returns extent of spatial coverage for a layer. ** ** If layer->extent is set then this value is used, otherwise the ** driver-specific implementation is called (this can be expensive). ** ** If layer is not already opened then it is opened and closed (so this ** function can be called on both opened or closed layers). ** ** Returns MS_SUCCESS/MS_FAILURE. */

Source from the content-addressed store, hash-verified

279** Returns MS_SUCCESS/MS_FAILURE.
280*/
281int msLayerGetExtent(layerObj *layer, rectObj *extent)
282{
283 int need_to_close = MS_FALSE, status = MS_SUCCESS;
284
285 if (MS_VALID_EXTENT(layer->extent))
286 {
287 *extent = layer->extent;
288 return MS_SUCCESS;
289 }
290
291 if (!msLayerIsOpen(layer))
292 {
293 if (msLayerOpen(layer) != MS_SUCCESS)
294 return MS_FAILURE;
295 need_to_close = MS_TRUE;
296 }
297
298 if ( ! layer->vtable) {
299 int rv = msInitializeVirtualTable(layer);
300 if (rv != MS_SUCCESS) {
301 if (need_to_close)
302 msLayerClose(layer);
303 return rv;
304 }
305 }
306 status = layer->vtable->LayerGetExtent(layer, extent);
307
308 if (need_to_close)
309 msLayerClose(layer);
310
311 return(status);
312}
313
314int msLayerGetItemIndex(layerObj *layer, char *item)
315{

Callers 3

msOWSGetLayerExtentFunction · 0.85
msRASTERLayerGetExtentFunction · 0.85
layer.cFile · 0.85

Calls 4

msLayerIsOpenFunction · 0.85
msLayerOpenFunction · 0.85
msInitializeVirtualTableFunction · 0.85
msLayerCloseFunction · 0.85

Tested by

no test coverage detected