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&#39;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-&gt;queryByRect($queryLayer-&gt;getExtent()); <br><br>in query.php (around line 320)<br><br>It&#39;s nothing to do with the getExtent function, as I tried putting my own values in there. I assume from the only related <a href="http://trac.osgeo.org/mapserver/ticket/3691">bug </a>I could find that this the error message indicates the layer can&#39;t be queried because it&#39;s already open.<br>
<br>Does that help track this down at all?<br><br>Steve<br><br><div class="gmail_quote">On Tue, May 3, 2011 at 1:03 PM, Dan Little <span dir="ltr">&lt;<a href="mailto:danlittle@yahoo.com">danlittle@yahoo.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_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-family: arial,helvetica,sans-serif; font-size: 10pt;">
<div><span>I think the querying it&#39;s doing is looking for metadata.  Does this layer map okay?  The error you&#39;re seeing is essentially &quot;Ack, I&#39;m MapServer and I can&#39;t figure out what the hell is going on with this layer!&quot;  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: &#39;times new roman&#39;,&#39;new york&#39;,times,serif;"><font face="Arial" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Stephen Knox &lt;<a href="mailto:stephenknox73@gmail.com" target="_blank">stephenknox73@gmail.com</a>&gt;<br>
<b><span style="font-weight: bold;">To:</span></b> <a href="mailto:geomoose-users@lists.sourceforge.net" target="_blank">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></div><div class="h5"><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-&gt;layerinfo != ((void *)0)&#39; failed.<br><br>I have the following section of mapbook:<br><br>    &lt;service name=&quot;search_oas&quot;&gt;<br>

        &lt;url&gt;php/query.php&lt;/url&gt;<br>        &lt;step type=&quot;input&quot;&gt;<br><br>            &lt;input type=&quot;select&quot; name=&quot;comparitor0&quot; title=&quot;Percentage Travel by UG 2001&quot;&gt;<br>

                &lt;option value=&quot;gt&quot;&gt;Greater Than&lt;/option&gt;<br>                &lt;option value=&quot;eq&quot;&gt;Equal To&lt;/option&gt;<br>                &lt;option value=&quot;lt&quot;&gt;Less Than&lt;/option&gt;<br>

            &lt;/input&gt;<br>            &lt;input type=&quot;user&quot; name=&quot;value0&quot; title=&quot;&quot;/&gt;<br>            &lt;input type=&quot;hidden&quot; name=&quot;highlight&quot; value=&quot;true&quot;/&gt;<br>

            &lt;input type=&quot;hidden&quot; name=&quot;mode&quot; value=&quot;search&quot;/&gt;<br><br>            &lt;input type=&quot;hidden&quot; name=&quot;layer0&quot; value=&quot;uglines/oas&quot;/&gt;<br>            &lt;input type=&quot;hidden&quot; name=&quot;template0&quot; value=&quot;itemquery&quot;/&gt;<br>

            &lt;input type=&quot;hidden&quot; name=&quot;zoom_to_first&quot; value=&quot;false&quot;/&gt;<br>            &lt;input type=&quot;hidden&quot; name=&quot;fieldname0&quot; value=&quot;per_ttw_lu&quot;/&gt;<br>
        &lt;/step&gt;<br>
    &lt;/service&gt;<br><br>and the layer definition below:<br><br>LAYER<br>CONNECTIONTYPE postgis<br>NAME &quot;oas&quot;<br>CONNECTION &quot;user=postgres password=postgres dbname=lustations host=localhost&quot;<br>DATA &quot;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&quot;<br>

STATUS ON<br>TYPE POLYGON<br><br>METADATA<br>identify_record &quot;identify_oas.html&quot;<br>itemquery &quot;oa_itemquery.html&quot;<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>&lt;!-- MapServer Template --&gt;<br>&lt;tr bgcolor=&quot;#DEE5EB&quot;&gt;&lt;td colspan=&quot;2&quot;&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=&quot;right&quot;&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=&quot;right&quot;&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></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 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 href="mailto:Geomoose-users@lists.sourceforge.net" target="_blank">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></div></blockquote></div><br>