[mapserver-users] RE: Problems with Query Template
Andy Hird
andy.hird at aligned-assets.co.uk
Tue May 3 08:22:50 PDT 2011
Steve,
Thanks so much for the reply and apologies for long delay (have been on holiday).
I have carried out the url line you specified
http://localhost/cgi-bin/mapserv.exe?MAP=/ms4w/apps/MFRS_Maps/Map/MFRS_Maps.map&qlayer=Wards&qindex=1&mode=indexquery
and the result is as follows:
1. Internet Explorer Returns:
msQueryByIndex(): Search returned no results. Not valid record request.
2. In my ms_error.txt file I am returned with:
[Tue May 03 16:12:13 2011].244000 CGI Request 1 on process 7676
[Tue May 03 16:12:13 2011].244000 msQueryByIndex(): Search returned no results. Not valid record request.
[Tue May 03 16:12:13 2011].244000 msFreeMap(): freeing map at 01C8AF68.
I have tried to look up what the message means and I can only assume its an issue with the Template side of things?
Using my shape file layer:
http://localhost/cgi-bin/mapserv.exe?MAP=/ms4w/apps/MFRS_Maps/Map/MFRS_Maps.map&qlayer=10K+StreetView&qindex=1&mode=indexquery
I get this back:
msQueryByIndex(): Search returned no results. Not valid record request. msRASTERLayerGetShape(): General error message. Out of range shape index requested. Requested -1 but only 0 shapes available.
I am really quite stumped and unfortunately running out of time to throw at this. Any help would help greatly.
Thanks in advance
Andy
----------------------------------------------------------------------
Message: 1
Date: Wed, 13 Apr 2011 13:59:34 -0500
From: "Lime, Steve D (DNR)" <steve.lime at state.mn.us>
Subject: [mapserver-users] RE: Problems with Query Template
(Chameleon)
To: Andy Hird <andy.hird at aligned-assets.co.uk>,
"mapserver-users at lists.osgeo.org" <mapserver-users at lists.osgeo.org>
Message-ID:
<A7F7B3043D3BF0438F1206BAA3C9933C08317124FD at MNMAIL05.ead.state.mn.us>
Content-Type: text/plain; charset="utf-8"
There’s nothing in the templates that would care about the data source be it shapefile or mapinfo tab file. If it were something like missing attributes you should get the template content back but without tags being processed. Can you take this outside of Chameleon to debug?
You could issue a query against the MasterMap Area layer and see what happens. For example:
http://yourserver/cgi-bin/mapserv.exe?/yourmapfile.map&qlayer=MasterMap+Area&qindex=1&mode=indexquery
That should pull the first record from the MasterMap Area layer.
Steve
From: Andy Hird [mailto:andy.hird at aligned-assets.co.uk]
Sent: Tuesday, April 12, 2011 4:28 PM
To: Lime, Steve D (DNR); mapserver-users at lists.osgeo.org
Subject: RE: Problems with Query Template (Chameleon)
Steve
Thanks for the reply.
There are no errors being logged and as I say it works for files which are not MapInfo Tab files. For instance the following works fine.
LAYER
NAME "10K StreetView"
STATUS ON
TYPE RASTER
MINSCALEDENOM 6000 #600
MAXSCALEDENOM 22499 #2999
TILEINDEX "C:\ms4w\apps\XXXX\data\10K.shp"
TILEITEM "LOCATION"
CLASS
TEMPLATE "templates/XXXX.html" #TOLERANCE 6 TOLERANCEUNITS PIXELS
END
END
I assume that this is because it’s a shp file which has a dbf file.
This does not work:
LAYER
NAME "MasterMap Area"
TYPE POLYGON
MINSCALEDENOM 1
MAXSCALEDENOM 5999
STATUS ON
CONNECTIONTYPE OGR
CONNECTION "C:\ms4w\apps\XXXX\data\MM_Topo_Area.TAB"
STYLEITEM "AUTO"
CLASS
TEMPLATE "templates/XXXX.html" #TOLERANCE 6 TOLERANCEUNITS PIXELS
END # Class section
HEADER "templates/XXXX_header.html"
FOOTER "templates/XXXX_footer.html"
END
Its bugging me like crazy as I can’t figure it out, - the second part of my question was:
“However If someone can provide example of placing a button on a html page that would call query functionality that would be very helpful too.â€
If it’s easier for someone to advise on that it would be appreciated.
Thanks
Andy
From: Lime, Steve D (DNR) [mailto:steve.lime at state.mn.us]
Sent: 11 April 2011 22:49
To: Andy Hird; mapserver-users at lists.osgeo.org
Subject: RE: Problems with Query Template (Chameleon)
Not a Chameleon user so I may not be of much help. Any errors being logged? What does the template file look like? It’s possible that ms4w_2.3.1’s MapServer did not require a magic string be on the first line of the template. In new versions it is required. Basically the first line of a template must contain the string “MapServer Templateâ€. Typically you’d put that in a HTML comment, e.g.:
<!—MapServer Tempate -->
...template follows...
That’s my first guess anyway.
Steve
From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Andy Hird
Sent: Friday, April 08, 2011 3:00 AM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] Problems with Query Template (Chameleon)
Hi there - really need some help if you can please regarding Template Query feature, and I have googled to exhaustion :-/
Background:
I have an existing Map file referencing MapInfo Tab files running under ms4w_2.3.1 & chameleon_ms4w-2.4.1
I have installed ms4w - V3.0.1 and chameleon V2.6.0
Copied my Map file across and made the necessary adjustments to get it working.
However when using the Query Widget (info of layers at mouse click) against MapInfo Layers it is no longer returning results, and yet it did previously.
My knowledge is not that great in php etc – but I suspect that its requiring a dbf rather than MapInfo Tab as it does work with a shp, dbf set of files.
Can Anyone help please as I really struggling – ideally I just want to use the old widget.
However If someone can provide example of placing a button on a html page that would call query functionality that would be very helpful too.
Thanks in advance
Andy
More information about the MapServer-users
mailing list