[mapserver-users] savequery and queryfile

Lime, Steve D (DNR) steve.lime at state.mn.us
Thu May 19 06:57:20 PDT 2011


Hi Nikos: It's pretty straight forward. Using the CGI, if you issue a "mode=xxxquery" call with "savequery=true" MapServer will write a file that serializes the query parameters to a temporary file. Then, if you make a call with "mode=map" with "queryfile=queryfile name.qy" MapServer will execute that query and render a query map instead of a regular map.

The trick is how the file is named. MapServer CGI generates a unique ID each time it's run and it's used to name all temp files including the queryfile. Format is "map name + id.qy". You can access that ID via template. Often that's not possible and you might want to generate it yourself (as a pseudo-session id) and pass it using the id CGI param. This way the queryfile name is known on the client.

In OpenLayers-land I've used query files successfully to maintain a selection overlay layer even for complex queries. You can even maintain cache multiple queries using multiple session ids. Let me know if you need more info.

Steve

-----Original Message-----
From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of nikos at maich.gr
Sent: Wednesday, May 18, 2011 7:20 AM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] savequery and queryfile

 Hello,

 I am wondering if someone could explain how to use savequery and 
 queryfile
 functionality to make a query map persistent for further operations.
 I've read the docs but cant seem to get a handle on it.

 regards,
 nikos
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users



More information about the MapServer-users mailing list