[Geomoose-users] Strange PHP error on Query

Dan Little danlittle at yahoo.com
Wed May 4 09:14:55 EDT 2011


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.

Try putting an "echo" statement above the queryByRect and have it output the contents of the search extent.



>________________________________
>From: Stephen Knox <stephenknox73 at gmail.com>
>To: Dan Little <danlittle at yahoo.com>
>Cc: "geomoose-users at lists.sourceforge.net" <geomoose-users at lists.sourceforge.net>
>Sent: Tuesday, May 3, 2011 8:38 PM
>Subject: Re: [Geomoose-users] Strange PHP error on Query
>
>
>Incidentally, the same service doesn't appear to be working on the demo site (http://www.geomoose.org/demo/geomoose2/geomoose.html#) (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).
>
>
>On Tue, May 3, 2011 at 10:26 PM, Stephen Knox <stephenknox73 at gmail.com> wrote:
>
>Don't think that's it it's still not working. I think it is the queryByRect function itself.
>>
>>
>>
>>On Tue, May 3, 2011 at 8:27 PM, Dan Little <danlittle at yahoo.com> wrote:
>>
>>Oh, Doh, yeah, MapServer cannot automatically pick up the extent of a PostGIS layer.  You need to specify it manually...
>>>
>>>
>>>LAYER 
>>> ... stuff ...
>>> EXTENT minx,miny,maxx,maxy
>>> ... stuff ...
>>>END
>>>
>>>
>>>
>>>>________________________________
>>>> From: Stephen Knox <stephenknox73 at gmail.com>
>>>>To: Dan Little <danlittle at yahoo.com>
>>>>Cc: "geomoose-users at lists.sourceforge.net" <geomoose-users at lists.sourceforge.net>
>>>>Sent: Tuesday, May 3, 2011 2:25 PM
>>>>
>>>>Subject: Re: [Geomoose-users] Strange PHP error on Query
>>>>
>>>>
>>>>
>>>> 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.
>>>>
>>>>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. 
>>>>
>>>>The error seems to be coming in on the call to 
>>>>
>>>>$queryLayer->queryByRect($queryLayer->getExtent()); 
>>>>
>>>>in query.php (around line 320)
>>>>
>>>>It's nothing to do with the getExtent function, as I tried putting my own values in there. I assume from the only related bug I could find that this the error message indicates the layer can't be queried because it's already open.
>>>>
>>>>Does that help track this down at all?
>>>>
>>>>Steve
>>>>
>>>>
>>>>On Tue, May 3, 2011 at 1:03 PM, Dan Little <danlittle at yahoo.com> wrote:
>>>>
>>>>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:
>>>>>
>>>>>
>>>>>1) Ensure you can map the data.
>>>>>2) Convert your inner query into a view and make sure there is a valid entry in geometry_columns for the view.
>>>>>3) Curse aloud to others.
>>>>>4) Repost to mailing list if none of the above works.
>>>>>
>>>>>
>>>>>
>>>>>>________________________________
>>>>>>From: Stephen Knox <stephenknox73 at gmail.com>
>>>>>>To: geomoose-users at lists.sourceforge.net
>>>>>>Sent: Monday, May 2, 2011 7:02 PM
>>>>>>Subject: Re: [Geomoose-users] Strange PHP error on Query
>>>>>>
>>>>>>
>>>>>>
>>>>>>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: 
>>>>>>httpd: mappostgis.c:1882: msPostGISLayerResultsGetShape: Assertion `layer->layerinfo != ((void *)0)' failed.
>>>>>>
>>>>>>I have the following section of mapbook:
>>>>>>
>>>>>>    <service name="search_oas">
>>>>>>        <url>php/query.php</url>
>>>>>>        <step type="input">
>>>>>>
>>>>>>            <input type="select" name="comparitor0" title="Percentage Travel by UG 2001">
>>>>>>                <option value="gt">Greater Than</option>
>>>>>>                <option value="eq">Equal To</option>
>>>>>>                <option value="lt">Less Than</option>
>>>>>>            </input>
>>>>>>            <input type="user" name="value0" title=""/>
>>>>>>            <input type="hidden" name="highlight" value="true"/>
>>>>>>            <input type="hidden" name="mode" value="search"/>
>>>>>>
>>>>>>            <input type="hidden" name="layer0" value="uglines/oas"/>
>>>>>>            <input type="hidden" name="template0" value="itemquery"/>
>>>>>>            <input type="hidden" name="zoom_to_first" value="false"/>
>>>>>>            <input type="hidden" name="fieldname0" value="per_ttw_lu"/>
>>>>>>        </step>
>>>>>>    </service>
>>>>>>
>>>>>>and the layer definition below:
>>>>>>
>>>>>>LAYER
>>>>>>CONNECTIONTYPE postgis
>>>>>>NAME "oas"
>>>>>>CONNECTION "user=postgres password=postgres dbname=lustations host=localhost"
>>>>>>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"
>>>>>>STATUS ON
>>>>>>TYPE POLYGON
>>>>>>
>>>>>>METADATA
>>>>>>identify_record "identify_oas.html"
>>>>>>itemquery "oa_itemquery.html"
>>>>>>END
>>>>>>
>>>>>>CLASS
>>>>>>    STYLE
>>>>>>        OUTLINECOLOR 0 0 0
>>>>>>        #COLOR 216 250 138
>>>>>>        WIDTH 1
>>>>>>    END
>>>>>>END
>>>>>>END
>>>>>>
>>>>>>my oa_itemquery.html looks like this:
>>>>>>
>>>>>><!-- MapServer Template -->
>>>>>><tr bgcolor="#DEE5EB"><td colspan="2"><b><u>Output Areas</u></b></tr>
>>>>>><tr>
>>>>>><td align="right"><b>Census Code:</b></td>
>>>>>><td>[census_code]</td>
>>>>>></tr>
>>>>>><tr>
>>>>>><td align="right"><b>Percentage travel by LU:</b></td>
>>>>>><td>[per_ttw_lu]</td>
>>>>>></tr>
>>>>>><tr>
>>>>>><td>&nbsp;</td>
>>>>>><td>&nbsp;</td>
>>>>>></tr>
>>>>>>
>>>>>>
>>>>>>------------------------------------------------------------------------------
>>>>>>WhatsUp Gold - Download Free Network Management Software
>>>>>>The most intuitive, comprehensive, and cost-effective network 
>>>>>>management toolset available today.  Delivers lowest initial 
>>>>>>acquisition cost and overall TCO of any competing solution.
>>>>>>http://p.sf.net/sfu/whatsupgold-sd
>>>>>>_______________________________________________
>>>>>>Geomoose-users mailing list
>>>>>>Geomoose-users at lists.sourceforge.net
>>>>>>https://lists.sourceforge.net/lists/listinfo/geomoose-users
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>>>
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geomoose-users/attachments/20110504/1416ccbe/attachment.html


More information about the Geomoose-users mailing list