[mapserver-users] Re: query issues
Daniel Morissette
morissette at dmsolutions.ca
Fri Jun 22 10:17:18 PDT 2001
> Ludovic Tenant wrote:
>
> I have two problems using queries.
>
> First, I can't succeed in making the method queryusingpoint() work
> when called from a layer object (whereas this method works when called
> from a map object...). Here is how I defined my layer, and the portion
> of PHP script I used to call the query :
>
...snipped...
>
> $point = ms_newPointObj();
> $point->setXY($geoRefx, $geoRefy);
> $queryLayer = $map->getLayerByName("test1");
> $result = $queryLayer->queryusingpoint($point,MS_SINGLE,-1); //error
> at this line
>
> Do you see something wrong here ?
>
I don't see why your code would work with a map query and not with a
layer query. Do you actually get an error message or just no result?
Also, which version of PHP_MAPSCRIPT are you using? Perhaps you could
try 3.4 ... previous versions may have had a problem with the
$layer->queryUsingPoint()... not sure?
>
> The second thing I was wondering is how to use the QueryObj class in
> mapscript, because no other class seems to interact with QueryObj, as
> far as I can see in the PHP/Mapscript doc. So I don't see how to
> "link" a QueryObj with others objects like MapObj, LayerObj...
>
MapScript 3.4 and previous versions were lacking a
$layer->GetQueryObject() or similar call to fetch a handle on an
existing queryObj from the mapfile... so it was impossible to modify
existing QUERY objects from the map file... you could only create new
ones using ms_newQueryObj($layer).
In 3.5 this won't be an issue any more since the queryObj is gone.
--
------------------------------------------------------------
Daniel Morissette morissette at dmsolutions.ca
DM Solutions Group http://www.dmsolutions.ca/
------------------------------------------------------------
Don't put for tomorrow what you can do today, because if
you enjoy it today you can do it again tomorrow.
More information about the MapServer-users
mailing list