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

Function msDrawVectorLayer

mapdraw.c:782–1065  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

780}
781
782int msDrawVectorLayer(mapObj *map, layerObj *layer, imageObj *image)
783{
784 int status, retcode=MS_SUCCESS;
785 char annotate=MS_TRUE;
786 shapeObj shape;
787 rectObj searchrect;
788 char cache=MS_FALSE;
789 int maxnumstyles=1;
790 featureListNodeObjPtr shpcache=NULL, current=NULL;
791 int nclasses = 0;
792 int *classgroup = NULL;
793 double minfeaturesize = -1;
794 int maxfeatures=-1;
795 int featuresdrawn=0;
796
797 if (image)
798 maxfeatures=msLayerGetMaxFeaturesToDraw(layer, image->format);
799
800 //TODO TBT: draw as raster layer in vector renderers
801
802 annotate = msEvalContext(map, layer, layer->labelrequires);
803 if(map->scaledenom > 0) {
804 if((layer->labelmaxscaledenom != -1) && (map->scaledenom >= layer->labelmaxscaledenom)) annotate = MS_FALSE;
805 if((layer->labelminscaledenom != -1) && (map->scaledenom < layer->labelminscaledenom)) annotate = MS_FALSE;
806 }
807
808 /* reset layer pen values just in case the map has been previously processed */
809 msClearLayerPenValues(layer);
810
811 /* open this layer */
812 status = msLayerOpen(layer);
813 if(status != MS_SUCCESS) return MS_FAILURE;
814
815 /* build item list */
816 status = msLayerWhichItems(layer, MS_FALSE, NULL);
817
818 if(status != MS_SUCCESS) {
819 msLayerClose(layer);
820 return MS_FAILURE;
821 }
822
823 /* identify target shapes */
824 if(layer->transform == MS_TRUE)
825 searchrect = map->extent;
826 else {
827 searchrect.minx = searchrect.miny = 0;
828 searchrect.maxx = map->width-1;
829 searchrect.maxy = map->height-1;
830 }
831
832#ifdef USE_PROJ
833 if((map->projection.numargs > 0) && (layer->projection.numargs > 0))
834 msProjectRect(&map->projection, &layer->projection, &searchrect); /* project the searchrect to source coords */
835#endif
836
837 status = msLayerWhichShapes(layer, searchrect, MS_FALSE);
838 if(status == MS_DONE) { /* no overlap */
839 msLayerClose(layer);

Callers 1

msDrawLayerFunction · 0.85

Calls 15

msEvalContextFunction · 0.85
msClearLayerPenValuesFunction · 0.85
msLayerOpenFunction · 0.85
msLayerWhichItemsFunction · 0.85
msLayerCloseFunction · 0.85
msProjectRectFunction · 0.85
msLayerWhichShapesFunction · 0.85
msInitShapeFunction · 0.85
Pix2LayerGeorefFunction · 0.85
msLayerNextShapeFunction · 0.85

Tested by

no test coverage detected