[mapserver-users] perl mapscript queryByRect() and queryByPoint() in 3.5

Lowell Filak lfilak at medinaco.org
Wed May 8 08:37:28 EDT 2002


Actually the result is in $layer->getResult(0) . The layer->{resultcache} is for doing things like $result_cache->{numresults}. And you guessed it, the query...() returns a status.
I did have a typo in the latest version of the Perl-MapScript docs that may have confused things but an update should be posted very soon.
Also an example of a query is due to be posted to the wiki very soon. (Don't let that stop you from posting your example however).
Lowell F.

The following message was sent by imap at chesapeake.net on Wed, 08 May 2002 05:39:25 -0400.

> 
> 
> Guys, I wanted to contribute some stuff to the Perl MapScript Wiki,
> but when I went to test things out, all my query stuff is broken
> under version 3.5/3.6.  
> 
> Going over some recent emails in the archive,
> it is my understanding that queryByRect($rect) now returns
> an integer (I am guessing status) and you have to get the
> results from the layer->{'resultcache'}.  
> 
> $layer = $querymap->getLayerByName("county");
> $status = $map->queryByRect($rect);
> print "status of query: ".$status."\n";
> $results = $layer->{'resultcache'};
> print "number of results: ".$results->{'numresults'}."\n";
> 
> status of query: 1
> number of results: 
> 
> 
> ------- mapfile ----------
> 
> LAYER
>   NAME county
>   TYPE LINE
>   STATUS ON
>   DATA "dtl_cnty"
>   TEMPLATE dummy
> END
> 
> 
> bah...  and queryByPoint() is behaving the same way.
> Does anybody have an example of queryByRect() and/or
> queryByPoint() working in perl mapscript?
> 
> Regards,
> 
> Chris




More information about the mapserver-users mailing list