MCPcopy Create free account
hub / github.com/MapServer/MapServer / msIntersectPolylinePolygon

Function msIntersectPolylinePolygon

mapsearch.c:264–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264int msIntersectPolylinePolygon(shapeObj *line, shapeObj *poly) {
265 int i;
266
267 /* STEP 1: polygon might competely contain the polyline or one of it's parts (only need to check one point from each part) */
268 for(i=0; i<line->numlines; i++) {
269 if(msIntersectPointPolygon(&(line->line[i].point[0]), poly) == MS_TRUE) /* this considers holes and multiple parts */
270 return(MS_TRUE);
271 }
272
273 /* STEP 2: look for intersecting line segments */
274 if (msIntersectPolylines(line, poly) == MS_TRUE)
275 return (MS_TRUE);
276
277 return(MS_FALSE);
278}
279
280int msIntersectPolygons(shapeObj *p1, shapeObj *p2) {
281 int i;

Callers 5

msQueryByRectFunction · 0.85
msQueryByFeaturesFunction · 0.85
msQueryByShapeFunction · 0.85
msGEOSIntersectsFunction · 0.85
shapeObj_intersectsFunction · 0.85

Calls 2

msIntersectPointPolygonFunction · 0.85
msIntersectPolylinesFunction · 0.85

Tested by

no test coverage detected