[mapserver-users] intersect
Lowell Filak
lfilak at medinaco.org
Thu Aug 22 05:27:39 PDT 2002
I don't believe 'intersect' is intended for use with a point. Check out:
http://www.ic.arizona.edu/~agave/agave_gis04b.htm for a quick diagram of what intersect is intended to do.
HTH
Lowell F.
The following message was sent by jef.mony at free.fr on Thu, 22 Aug 2002 10:43:09 +0200.
> Hi,
>
> I noticed a little problem with the intersects function of the ShapeObj.
> I have two Shapes : a polygon and a point
>
>
> $line = ms_newLineObj();
> $line->addXY($Xmin,$Ymax);
> $line->addXY($Xmax,$Ymax);
> $line->addXY($Xmax,$Ymin);
> $line->addXY($Xmin,$Ymin);
> $line->addXY($Xmin,$Ymax);
> $poly = ms_newShapeObj(MS_SHAPE_POLYGON);
> $poly->add($line);
>
> $line2 = ms_newLineObj();
> $line2->addXY($Xmin,$Ymax);
> $poly2 = ms_newShapeObj(MS_SHAPE_POINT);
> $poly2->add($line2);
>
> If I try $poly->intersects($poly2) I have a wrong result, in fact it's like I
> would have test the intersection between the pôint and the boundaries of
> the poly ...
> but If I use $poly2->contains($pt) with pt a point with the same coords that
> the poly2 it's work fine ...
>
> An idea, is it a bug or a wrong use ?
>
> Thanks
More information about the MapServer-users
mailing list