problem with GEOS contains query

Yewondwossen Assefa assefa at DMSOLUTIONS.CA
Tue Mar 21 20:34:19 EST 2006


Mark,

  Does the contain work in other circumpstances ?

  Here is the test I just did with the 4.9 cvs and It returns ok. Does 
this work for you ?

<?php

dl("php_mapscript_49-dev.dll");


$shape1 =  ms_shapeObjFromWkt("POLYGON((0.0 0.0, 0.0 2.0, 2.0 2.0, 2.0 
0.0, 0.0 0.0))");

$shape2 =  ms_shapeObjFromWkt("POLYGON((0.5 0.5, 0.5 1.5, 1.5 1.5, 1.5 
0.5, 0.5 0.5))");

if ($shape1->containsShape($shape2))
      echo "1\n";
  else
   echo "0\n";

if ($shape2->containsShape($shape1))
  echo "1\n";
  else
   echo "0\n";

if ($shape2->containsShape($shape2))
  echo "1\n";
  else
   echo "0\n";

//phpinfo();

?>


Later,

Mark Adams wrote:
> Hi all,
> 
> We're working with the new GEOS "contains" operator support in the 4.9 CVS.
> 
> When trying to execute this function we're getting an error “Object has an
> invalid _handle_ property in …“.  I’ve attached a snippet of code below.
> Any suggestions would be greatly appreciated.
> 
> $oRes = $bufferLayer->getResult($bfres);
> $shp = $bufferLayer->getShape($oRes->tileindex, $oRes->shapeindex);
> printf($oShape1->contains($shp) ."\n");
> if($oShape1->contains($shp) == 1)
> 
> {
> 
> }
> -------------------
> Mark Adams
> DPRA Canada
> mark.adams at dpra.com
> 


-- 
----------------------------------------------------------------
Assefa Yewondwossen
Software Analyst

Email: assefa at dmsolutions.ca
http://www.dmsolutions.ca/

Phone: (613) 565-5056 (ext 14)
Fax:   (613) 565-0925
----------------------------------------------------------------



More information about the mapserver-users mailing list