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

Function msComputeBounds

mapprimitive.c:196–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196void msComputeBounds(shapeObj *shape)
197{
198 int i, j;
199 if(shape->numlines <= 0) return;
200 for(i=0;i<shape->numlines;i++) {
201 if(shape->line[i].numpoints > 0) {
202 shape->bounds.minx = shape->bounds.maxx = shape->line[i].point[0].x;
203 shape->bounds.miny = shape->bounds.maxy = shape->line[i].point[0].y;
204 break;
205 }
206 }
207 if(i == shape->numlines)
208 return; //no lines inside the shape contain any points
209
210 for( i=0; i<shape->numlines; i++ ) {
211 for( j=0; j<shape->line[i].numpoints; j++ ) {
212 shape->bounds.minx = MS_MIN(shape->bounds.minx, shape->line[i].point[j].x);
213 shape->bounds.maxx = MS_MAX(shape->bounds.maxx, shape->line[i].point[j].x);
214 shape->bounds.miny = MS_MIN(shape->bounds.miny, shape->line[i].point[j].y);
215 shape->bounds.maxy = MS_MAX(shape->bounds.maxy, shape->line[i].point[j].y);
216 }
217 }
218}
219
220/* checks to see if ring r is an outer ring of shape */
221int msIsOuterRing(shapeObj *shape, int r)

Callers 15

msDrawTransformedShapeFunction · 0.85
msQueryByFeaturesFunction · 0.85
msQueryByShapeFunction · 0.85
msDrawShapeFunction · 0.85
msPostGISReadShapeFunction · 0.85
msRasterQueryByShapeFunction · 0.85
msRASTERLayerGetShapeFunction · 0.85
msProjectShapeFunction · 0.85
get_metricsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected