[mapserver-users] intersect
   
    jef.mony@free.fr
     
    jef.mony@free.fr
       
    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