How to query for polygon attributes using PHPMapscript?

John jkim at SCIENCES.SDSU.EDU
Mon Jun 27 01:29:14 EDT 2005


Doh! It must be Murphy's law for asking lists: I stumbled upon a PHP query
example in the list archive soon after I submitted my question. It was in a
post by Jerod Clabaugh, dated 11-Mar-2005, titled "MapScript queryByPoint
index error". His logic is, essentially:

if ( MS_SUCCESS == @$layer->queryByPoint( $point, MS_MULTIPLE, -1 ) ) {
  $layer->open();
  for( $i = 0; $i < $layer->getNumResults(); $i++ ){
      $shape = $layer->getShape(-1, $layer->getResult($i)->shapeindex );
      // Do what I want with $shape->values;
  }
 $layer->close();
}

One question: why use MS_MULTIPLE? Can queryByPoint() return multiple
shapes?

-John


----- Original Message -----
From: "John" <jkim at sciences.sdsu.edu>
Sent: Sunday, June 26, 2005 9:37 PM
Subject: How to query for polygon attributes using PHPMapscript?


> Hi,
>
> I don't understand how a query works using PHP/Mapscript.
> ...
>
> -John



More information about the mapserver-users mailing list