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

Function msSHPLayerWhichShapes

mapshape.c:2538–2570  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2536}
2537
2538int msSHPLayerWhichShapes(layerObj *layer, rectObj rect, int isQuery)
2539{
2540 int i, n1=0, n2=0;
2541 int status;
2542 shapefileObj *shpfile;
2543
2544 shpfile = layer->layerinfo;
2545
2546 if(!shpfile) {
2547 msSetError(MS_SHPERR, "Shapefile layer has not been opened.", "msSHPLayerWhichShapes()");
2548 return MS_FAILURE;
2549 }
2550
2551 status = msShapefileWhichShapes(shpfile, rect, layer->debug);
2552 if(status != MS_SUCCESS) {
2553 return status;
2554 }
2555
2556 /* now apply the maxshapes criteria (NOTE: this ignores the filter so you could get less than maxfeatures) */
2557 if(layer->maxfeatures > 0) {
2558
2559 for( i = (shpfile->numshapes - 1); i >= 0; i-- ) {
2560 n2 = msGetBit(shpfile->status, i);
2561 n1 += n2;
2562 if( n2 && n1 > layer->maxfeatures ) {
2563 msSetBit(shpfile->status, i, 0);
2564 }
2565 }
2566
2567 }
2568
2569 return MS_SUCCESS;
2570}
2571
2572int msSHPLayerNextShape(layerObj *layer, shapeObj *shape)
2573{

Callers

nothing calls this directly

Calls 4

msSetErrorFunction · 0.85
msShapefileWhichShapesFunction · 0.85
msGetBitFunction · 0.85
msSetBitFunction · 0.85

Tested by

no test coverage detected