[mapserver-users] php mapscript loadQuery problem

Moen, Paul T. pmoen at nd.gov
Mon Feb 8 13:51:01 EST 2010


The query file parser will throw a detailed error message if it has a parsing problem.


Where would I look for the errors that the query file parser throws?  I don't see any in the error_log for apache, which is where all my php errors are logged.  Does that mean that the parser is having no problems parsing the file, but something else goes awry?

I added some information hoping it may help.

This is my command from php
$test = $map->saveQuery("/tmp/testfile.txt");
error_log($test." ".MS_SUCCESS);
The output from the error_log line above is Testing save query: 0 0

I then try to load the query file with the following commands.
$test = $map->loadQuery("/tmp/testfile.txt");
error_log("Testing load = ".$test." - ".MS_SUCCESS);
The output from the error_log line above is Testing load = 1 - 0

Thanks,

Paul

On Feb 1, 2010, at 3:55 PM, Lime, Steve D (DNR) wrote:

I’ll send you more details when I get time tonite (I hope) and can test things. I’ve been using 5.6 save/load query functions a ton via the CGI but not PHP. I tested a bunch with Perl MapScript and will have to check those methods against what PHP is doing. Here’s what the lines mean:

Line – Contents
0 - magic string
1 - mode, type (single or multiple), qlayer, slayer
2 - point x, point y, buffer, max results (queryByPoint)
3 - query rect (minx, miny, maxx, maxy) (queryByRect)
4 - shp index, tile index, clear cache flag (queryByIndex)
5 - qitem or NULL (queryByAttribute)
6 - qstring or NULL
7 - operator (used by WFS)
8+ - query shape (queryByShape)

Basically each line or so after the first couple match a MapServer query method and it’s parameters. The file contents look fine to me. The query file parser will throw a detailed error message if it has a parsing problem.

Steve

From: mapserver-users-bounces at lists.osgeo.org<mailto:mapserver-users-bounces at lists.osgeo.org> [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Moen, Paul T.
Sent: Monday, February 01, 2010 2:42 PM
To: mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
Subject: [mapserver-users] php mapscript loadQuery problem

I have not been able to get loadQuery to work.  The saveQuery command creates the file and returns MS_SUCCESS.  When I try to load the file using loadQuery, it always returns MS_FAILURE.  I get no other errors.   The permissions are good.  Is there a way to enable more verbose error logging to find out what is going on?  Is there any documentation on what should be in the saved file?

The following is the text from one of the saved query files.

MapServer Query - Generated by msSaveQuery()
1 2 83 -1
-1 -1 0 0
2183769.22727273 944435.909090909 2331977.40909091 1066349.09090909
-1 -1 1
NULL
NULL
-1
0

This is my version.

MapServer version 5.6.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=CAIRO SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=GEOS INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE


Thanks,


Paul

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100208/1ba71939/attachment-0001.html


More information about the mapserver-users mailing list