[mapserver-users] selecting adjacent polygons

Dean Gadoury gadoury at dmsolutions.ca
Thu Aug 29 14:30:03 EDT 2002


This may sound weird, but determining how to select adjacent polygons
depends to a large degree on how you define adjacent. I apologize in advance
that this won't help clear things up at all and may actually muddy the
waters, but certain things should be kept in mind when approaching such a
problem. The solution to selecting adjacent polygons will depend on how you
want to define adjacent.
-First of all, when you say adjacent do you mean sharing a boundary, or
nearby? I worked on a municipal application one time in which adjacent could
mean either one - for example 2 properties across the street, or a sidewalk
from each other were cosidered adjacent as were properties 'next door' to
each other even though there was a space between the two.
-Are polygons that touch only at a corner considered adjacent, or must they
share a line boundary?
-Are overlapping polygons adjacent?
-There could be other similar scenarios in which adjacency is not perfectly
clear.



-----Original Message-----
From: owner-mapserver-users at lists.gis.umn.edu
[mailto:owner-mapserver-users at lists.gis.umn.edu]On Behalf Of Lowell
Filak
Sent: Thursday, August 29, 2002 9:24 AM
To: andrea.giacomelli at fst.it; mapserver-users at lists.gis.umn.edu
Subject: Re: [mapserver-users] selecting adjacent polygons


The closest we get right now is to use the least bounding rectangle for the
selected polygon & then use the rectangle to overlay and select other
polygons. It is not exact and is a pain when dealing with long diagonal
polygons. Perhaps there is a way to use the $layer->queryByShape() method to
do this... The trick would be to somehow force the shape being used for the
query to "grow" by a foot so when the overlay was done it would indeed
overlap neighboring shapes. As far as forcing it to grow, I'm not sure.
Possibly the $shape->project() method could be used to do this???
This may not help but it will hopefully spark discussion.
Lowell F.

The following message was sent by "Andrea Giacomelli"
<andrea.giacomelli at fst.it> on Tue, 27 Aug 2002 14:39:44 +0200.

> Hi,
>
> Is it possible to implement a "select feature, and identify adjacent
> polygons" mechanism via mapserver ?
>
> TIA for any feedback,
>
> andrea giacomelli
>




More information about the mapserver-users mailing list