How to query for polygon attributes using PHPMapscript?

Steven Monai stevem at SPATIALMAPPING.COM
Tue Jun 28 10:54:30 EDT 2005


Yes, queryByPoint() can certainly return multiple shapes. The main reason
is that queryByPoint() actually queries not just a single point, but a
circular area with a radius of TOLERANCE. Furthermore, even when the query
TOLERANCE is zero, it is possible that multiple features of a layer may
overlap at a given point.

Regards,
-SM
--


On Mon, 27 Jun 2005 00:29:14 -0500, John <jkim at SCIENCES.SDSU.EDU> wrote:

>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