<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div><span>I think the querying it's doing is looking for metadata. &nbsp;Does this layer map okay? &nbsp;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!" &nbsp;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-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 &lt;stephenknox73@gmail.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> geomoose-users@lists.sourceforge.net<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><br>
<div id="yiv1806485595">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-&gt;layerinfo != ((void *)0)' failed.<br><br>I have the following section of mapbook:<br><br>&nbsp;&nbsp;&nbsp; &lt;service name="search_oas"&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;url&gt;php/query.php&lt;/url&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;step type="input"&gt;<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;input type="select" name="comparitor0" title="Percentage Travel by UG 2001"&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;option value="gt"&gt;Greater Than&lt;/option&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;option value="eq"&gt;Equal To&lt;/option&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;option value="lt"&gt;Less Than&lt;/option&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/input&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;input type="user" name="value0" title=""/&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;input type="hidden" name="highlight" value="true"/&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;input type="hidden" name="mode" value="search"/&gt;<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;input type="hidden" name="layer0" value="uglines/oas"/&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;input type="hidden" name="template0" value="itemquery"/&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;input type="hidden" name="zoom_to_first" value="false"/&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;input type="hidden" name="fieldname0" value="per_ttw_lu"/&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/step&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/service&gt;<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,&nbsp; 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>&nbsp;&nbsp;&nbsp; STYLE<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; OUTLINECOLOR 0 0 0<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; #COLOR 216 250 138<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; WIDTH 1<br>&nbsp;&nbsp;&nbsp; END<br>END<br>END<br><br>my oa_itemquery.html looks like this:<br><br>&lt;!-- MapServer Template --&gt;<br>&lt;tr bgcolor="#DEE5EB"&gt;&lt;td colspan="2"&gt;&lt;b&gt;&lt;u&gt;Output Areas&lt;/u&gt;&lt;/b&gt;&lt;/tr&gt;<br>
&lt;tr&gt;<br>&lt;td align="right"&gt;&lt;b&gt;Census Code:&lt;/b&gt;&lt;/td&gt;<br>&lt;td&gt;[census_code]&lt;/td&gt;<br>&lt;/tr&gt;<br>&lt;tr&gt;<br>&lt;td align="right"&gt;&lt;b&gt;Percentage travel by LU:&lt;/b&gt;&lt;/td&gt;<br>
&lt;td&gt;[per_ttw_lu]&lt;/td&gt;<br>&lt;/tr&gt;<br>&lt;tr&gt;<br>&lt;td&gt;&amp;nbsp;&lt;/td&gt;<br>&lt;td&gt;&amp;nbsp;&lt;/td&gt;<br>&lt;/tr&gt;<br><br>
</div><br>------------------------------------------------------------------------------<br>WhatsUp Gold - Download Free Network Management Software<br>The most intuitive, comprehensive, and cost-effective network <br>management toolset available today.&nbsp; Delivers lowest initial <br>acquisition cost and overall TCO of any competing solution.<br><a href="http://p.sf.net/sfu/whatsupgold-sd" target="_blank">http://p.sf.net/sfu/whatsupgold-sd</a><br>_______________________________________________<br>Geomoose-users mailing list<br><a ymailto="mailto:Geomoose-users@lists.sourceforge.net" href="mailto:Geomoose-users@lists.sourceforge.net">Geomoose-users@lists.sourceforge.net</a><br><a href="https://lists.sourceforge.net/lists/listinfo/geomoose-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/geomoose-users</a><br><br><br></div></div></blockquote></div></div></body></html>