Highlight a specific shape record

Lowell Filak lfilak at MEDINACO.ORG
Thu Feb 10 13:55:53 EST 2005


The following message was sent by Abe Gillespie <agillesp at VT.EDU> on
Wed, 9 Feb 2005 15:58:59 -0500.

> Is there anyway to highlight a specific shape if I know its tileindex
> and shapeindex?  These values are gathered from a prior query.  And
> then the user chooses a given record to zoom to.  I tried just using a
> shape query but this is returning puzzling results.  Here's some code
> that sorta does what I'm talking about:
>
> $layer->open();
> $s = $layer->getShape($tileindex, $shapeindex);
> $layer->queryByShape($s);
> $cnt = $layer->getNumResults();
>
> $cnt above is somewhere in the number of 150+ records.  This is weird
> because this is just a simple house layer where no houses are touching.
>   I also fool around with setting $layer->tolerance = -1 ... does
> setting the tolerance at runtime have any effect on the spatial query?
>
> I would still prefer a more direct method for highlighting the given
> shape just by using its tileindex and shapeindex.

Abe,

Is your getShape syntax correct? I believe it requires a shapeObj as an
argument. $s should just be an integer result of the method.

Lowell



More information about the mapserver-users mailing list