[Mapserver-dev] Rect in polygon function

woodbri at swoodbridge.com woodbri at swoodbridge.com
Sat Feb 8 19:59:21 EST 2003


While I'm sure there are a bunch of ways to detect this, my first 
thought is to do it like this:

1) check if any point is outside the polygon, 
    if yes done
2) check if any rect edge intersects the polygon boundary, 
    if yes done (there is a case where a polygon vertex lies on
    an edge that you can treat is a none intersection)
3) else it is contained

-Steve W.

On 8 Feb 2003 at 17:29, Daniel Morissette wrote:

> Steve, all,
> 
> We are looking for a function that would tell us if a rectangle is
> comprised completely inside a polygon, is such a function already
> available in MapServer or anywhere else?  What we're trying to do is
> find out if the current map view (a rectangle), is completely
> contained inside a polygon that represents available raster coverage. 
> If the map view is completely contained inside the raster coverage
> then we want to use a raster layer as the map, otherwise we want to
> use vector data.  We want to avoid having both the raster and vector
> layers showing up in the same map image, that's why we need this
> function to test if the current map view is completely contained
> inside the polygon defining the raster layer's coverage.
> 
> Thanks in advance for any help/pointers.
> 
> Daniel
> -- 
> ------------------------------------------------------------
>  Daniel Morissette               morissette at dmsolutions.ca
>  DM Solutions Group              http://www.dmsolutions.ca/
> ------------------------------------------------------------
> _______________________________________________
> Mapserver-dev mailing list
> Mapserver-dev at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-dev
> 





More information about the mapserver-dev mailing list