<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div><span>The demos on the website need massive maintenance, but you do need that directive in order for MapServer to intelligently work on the queryByRect call.</span></div><div><span><br></span></div><div><span>Try putting an "echo" statement above the queryByRect and have it output the contents of the search extent.</span></div><div><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div style="font-size: 10pt; font-family: arial, helvetica, sans-serif; "><div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "><font size="2" face="Arial"><hr size="1"><b><span style="font-weight:bold;">From:</span></b> Stephen Knox <stephenknox73@gmail.com><br><b><span style="font-weight: bold;">To:</span></b> Dan Little <danlittle@yahoo.com><br><b><span
style="font-weight: bold;">Cc:</span></b> "geomoose-users@lists.sourceforge.net" <geomoose-users@lists.sourceforge.net><br><b><span style="font-weight: bold;">Sent:</span></b> Tuesday, May 3, 2011 8:38 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Geomoose-users] Strange PHP error on Query<br></font><br><div id="yiv291634486">Incidentally, the same service doesn't appear to be working on the demo site (<a rel="nofollow" target="_blank" href="http://www.geomoose.org/demo/geomoose2/geomoose.html#">http://www.geomoose.org/demo/geomoose2/geomoose.html#</a>) (search Parcels functionality). It appears the same thing is happening as in my application. The debug output from mapserver seems to be getSymbol(): Symbol definition error. Parsing error near (per_ttw_lu):(line 297).<br>
<br><div class="yiv291634486gmail_quote">On Tue, May 3, 2011 at 10:26 PM, Stephen Knox <span dir="ltr"><<a rel="nofollow" ymailto="mailto:stephenknox73@gmail.com" target="_blank" href="mailto:stephenknox73@gmail.com">stephenknox73@gmail.com</a>></span> wrote:<br><blockquote class="yiv291634486gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex;">
Don't think that's it it's still not working. I think it is the queryByRect function itself.<div><div class="yiv291634486h5"><br><br><div class="yiv291634486gmail_quote">On Tue, May 3, 2011 at 8:27 PM, Dan Little <span dir="ltr"><<a rel="nofollow" ymailto="mailto:danlittle@yahoo.com" target="_blank" href="mailto:danlittle@yahoo.com">danlittle@yahoo.com</a>></span> wrote:<br>
<blockquote class="yiv291634486gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex;"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 10pt; font-family: arial, helvetica, sans-serif; ">
<div><span>Oh, Doh, yeah, MapServer cannot automatically pick up the extent of a PostGIS layer. You need to specify it manually...</span></div><div><span><br></span></div><div><span>LAYER </span></div><div><span> ... stuff ...</span></div>
<div><span> EXTENT minx,miny,maxx,maxy</span></div><div><span> ... stuff ...</span></div><div><span>END</span></div><div><br><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;">
<div style="font-size: 10pt; font-family: arial, helvetica, sans-serif; "><div style="font-size:12pt;"><font face="Arial" size="2"><div><hr size="1">
<b><span style="font-weight:bold;">From:</span></b> Stephen Knox <<a rel="nofollow" ymailto="mailto:stephenknox73@gmail.com" target="_blank" href="mailto:stephenknox73@gmail.com">stephenknox73@gmail.com</a>><br></div><b><span style="font-weight:bold;">To:</span></b> Dan
Little <<a rel="nofollow" ymailto="mailto:danlittle@yahoo.com" target="_blank" href="mailto:danlittle@yahoo.com">danlittle@yahoo.com</a>><br><b><span style="font-weight:bold;">Cc:</span></b> "<a rel="nofollow" ymailto="mailto:geomoose-users@lists.sourceforge.net" target="_blank" href="mailto:geomoose-users@lists.sourceforge.net">geomoose-users@lists.sourceforge.net</a>" <<a rel="nofollow" ymailto="mailto:geomoose-users@lists.sourceforge.net" target="_blank" href="mailto:geomoose-users@lists.sourceforge.net">geomoose-users@lists.sourceforge.net</a>><br>
<b><span style="font-weight:bold;">Sent:</span></b> Tuesday, May 3, 2011 2:25 PM<div><div><br><b><span style="font-weight:bold;">Subject:</span></b> Re: [Geomoose-users] Strange PHP error on Query<br>
</div></div></font><div><div><br>
<div> The data definitely maps OK. I can see it both in GeoMoose as a normal layer and in Mapserver. I can also see the calculated field with Identify. The problems just seems to be filtering/querying it.<br><br>I wondered whether it's something to do with my version - I am using 2.4RC1 and I saw reference to bugs relating to certain functions in this release on the mailing list. I am also using Mapserver 5.6.3 for Fedora 14. <br>
<br>The error seems to be coming in on the call to <br><br>$queryLayer->queryByRect($queryLayer->getExtent()); <br><br>in query.php (around line 320)<br><br>It's nothing to do with the getExtent function, as I tried putting my own values in there. I assume from the only related <a rel="nofollow" target="_blank" href="http://trac.osgeo.org/mapserver/ticket/3691">bug </a>I could find that this the error message indicates the layer can't be queried because it's already open.<br>
<br>Does that help track this down at all?<br><br>Steve<br><br><div>On Tue, May 3, 2011 at 1:03 PM, Dan Little <span dir="ltr"><<a rel="nofollow" ymailto="mailto:danlittle@yahoo.com" target="_blank" href="mailto:danlittle@yahoo.com">danlittle@yahoo.com</a>></span> wrote:<br>
<blockquote style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex;"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 10pt; font-family: arial, helvetica, sans-serif; ">
<div><span>I think the querying it's doing is looking for metadata. Does this layer map okay? The error you're seeing is essentially "Ack, I'm MapServer and I can't figure out what the hell is going on with this layer!" Some easy stuff to try:</span></div>
<div><span><br></span></div><div>1) Ensure you can map the data.</div><div>2) Convert your inner query into a view and make sure there is a valid entry in geometry_columns for the view.</div><div>3) Curse aloud to others.</div>
<div>4) Repost to mailing list if none of the above works.</div><div><br><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;"><div style="font-size: 10pt; font-family: arial, helvetica, sans-serif; ">
<div style="font-size:12pt;"><font face="Arial" size="2"><hr size="1"><b><span style="font-weight:bold;">From:</span></b> Stephen Knox <<a rel="nofollow" ymailto="mailto:stephenknox73@gmail.com" target="_blank" href="mailto:stephenknox73@gmail.com">stephenknox73@gmail.com</a>><br>
<b><span style="font-weight:bold;">To:</span></b> <a rel="nofollow" ymailto="mailto:geomoose-users@lists.sourceforge.net" target="_blank" href="mailto:geomoose-users@lists.sourceforge.net">geomoose-users@lists.sourceforge.net</a><br><b><span style="font-weight:bold;">Sent:</span></b> Monday, May 2, 2011 7:02 PM<br>
<b><span style="font-weight:bold;">Subject:</span></b> Re: [Geomoose-users] Strange PHP error on Query<br></font><div><div><br>
<div>Excuse my inexperience but I have another query about getting query functionality to work in GeoMoose. It seems to be querying the database for a few seconds, then I get no Valid Response and the following error in PHP: <br>
httpd: mappostgis.c:1882: msPostGISLayerResultsGetShape: Assertion `layer->layerinfo != ((void *)0)' failed.<br><br>I have the following section of mapbook:<br><br> <service name="search_oas"><br>
<url>php/query.php</url><br> <step type="input"><br><br> <input type="select" name="comparitor0" title="Percentage Travel by UG 2001"><br>
<option value="gt">Greater Than</option><br> <option value="eq">Equal To</option><br> <option value="lt">Less Than</option><br>
</input><br> <input type="user" name="value0" title=""/><br> <input type="hidden" name="highlight" value="true"/><br>
<input type="hidden" name="mode" value="search"/><br><br> <input type="hidden" name="layer0" value="uglines/oas"/><br> <input type="hidden" name="template0" value="itemquery"/><br>
<input type="hidden" name="zoom_to_first" value="false"/><br> <input type="hidden" name="fieldname0" value="per_ttw_lu"/><br>
</step><br>
</service><br><br>and the layer definition below:<br><br>LAYER<br>CONNECTIONTYPE postgis<br>NAME "oas"<br>CONNECTION "user=postgres password=postgres dbname=lustations host=localhost"<br>DATA "the_geom from (SELECT gid, the_geom, census_code, ttw_by_lu, (ttw_by_lu::REAL/tot_pop::REAL)*100 as per_ttw_lu, tot_pop FROM oa_data) as foo using srid=27700 using unique gid"<br>
STATUS ON<br>TYPE POLYGON<br><br>METADATA<br>identify_record "identify_oas.html"<br>itemquery "oa_itemquery.html"<br>END<br><br>CLASS<br> STYLE<br> OUTLINECOLOR 0 0 0<br> #COLOR 216 250 138<br>
WIDTH 1<br> END<br>END<br>END<br><br>my oa_itemquery.html looks like this:<br><br><!-- MapServer Template --><br><tr bgcolor="#DEE5EB"><td colspan="2"><b><u>Output Areas</u></b></tr><br>
<tr><br><td align="right"><b>Census Code:</b></td><br><td>[census_code]</td><br></tr><br><tr><br><td align="right"><b>Percentage travel by LU:</b></td><br>
<td>[per_ttw_lu]</td><br></tr><br><tr><br><td>&nbsp;</td><br><td>&nbsp;</td><br></tr><br><br>
</div><br></div></div>------------------------------------------------------------------------------<br>WhatsUp Gold - Download Free Network Management Software<br>The most intuitive, comprehensive, and cost-effective network <br>
management toolset available today. Delivers lowest initial <br>acquisition cost and overall TCO of any competing solution.<br><a rel="nofollow" target="_blank" href="http://p.sf.net/sfu/whatsupgold-sd">http://p.sf.net/sfu/whatsupgold-sd</a><br>
_______________________________________________<br>Geomoose-users mailing list<br><a rel="nofollow" ymailto="mailto:Geomoose-users@lists.sourceforge.net" target="_blank" href="mailto:Geomoose-users@lists.sourceforge.net">Geomoose-users@lists.sourceforge.net</a><br><a rel="nofollow" target="_blank" href="https://lists.sourceforge.net/lists/listinfo/geomoose-users">https://lists.sourceforge.net/lists/listinfo/geomoose-users</a><br>
<br><br></div></div></blockquote></div></div></div></blockquote></div><br>
</div><br><br></div></div></div></div></blockquote></div></div></div></blockquote></div><br>
</div></div></blockquote></div><br>
</div><br><br></div></div></blockquote></div></div></body></html>