[Geomoose-users] debugging mapserver WFS layer search

Eli Adam eadam at co.lincoln.or.us
Mon Jan 8 09:23:24 PST 2018


On Fri, Jan 5, 2018 at 9:52 AM, karsten <karsten at terragis.net> wrote:
> Thanks Eli.
>
> I have set the MS debug = 5 in the map file and also enabled postgresql
> logging.
>
> In the mapserver log I get "No matching record(s) found":
>
> ------------------
> [Fri Jan 05 18:32:59 2018].645000 msWFSParseRequest(): WFS post request:
> <GetFeature xmlns="http://www.opengis.net/wfs" service="WFS" version="1.1.0"
> outputFormat="text/xml; subtype=gml/2.1.2"
> xsi:schemaLocation="http://www.opengis.net/wfs
> http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Query
> typeName="ms:flurstueck_wfs" srsName="EPSG:4326"><Filter
> xmlns="http://www.opengis.net/ogc"><PropertyIsLike wildCard="*"
> singleChar="." escapeChar="!"
> matchCase="false"><PropertyName>lagebezeichnung</PropertyName><Literal>*Plat
> ten*</Literal></PropertyIsLike></Filter></Query></GetFeature>
> [Fri Jan 05 18:32:59 2018].728000 FLTLayerApplyPlainFilterToLayer():
> ("[lagebezeichnung]" ~* ".*Platten.*"),
> rect=-7.34596005204958,60.6642900785306,6.38576697281957,66.6415244533575
> [Fri Jan 05 18:32:59 2018].758000 msQueryByFilter(): Search returned no
> results. No matching record(s) found.
> ------------------
>
> and in the postgresql log I
>
> PST ERROR:  syntax error at or near "*" at character 514 PST STATEMENT:
> SELECT gml_id, identifier, beginnt, advstandardmodell, anlass, land,
>                gemarkungsnummer, zaehler, flurstueckskennzeichen, gemarkung,
>
>                amtlicheflaeche, flurnummer, abweichenderrechtszustand,
> rechtsbehelfsverfahren,
>                zeitpunktderentstehung, regierungsbezirk, kreis, gemeinde,
> istgebucht,
>                zeigtauf, weistauf, nenner, zweifelhafterflurstuecksnachweis,
>
>                ogc_fid, fid, gid, wkb_geometry, fc, lagebezeichnung,
> eigentuemer
>           FROM public.gm_ax_flurstueck_geo where lagebezeichnung ilike
> *Platten*;
>
> This seems to hint to that the query send via geomoose seems to have a
> problem with the syntax. When I change it to ... FROM
> public.gm_ax_flurstueck_geo where lagebezeichnung ilike '%Platten%'; and run
> manually it is working ...
>
> Not sure if there is a work around or other config for the postgis layer
> that I can use in Geomoose ...

I opened an issue for discussion here,
https://github.com/geomoose/gm3/issues/279.  That also suggests where
to look if you want to fiddle with it.

Best regards, Eli


>
> Karsten
>
> -----Original Message-----
> From: Eli Adam [mailto:eadam at co.lincoln.or.us]
> Sent: Freitag, 5. Januar 2018 18:08
> To: karsten
> Cc: geomoose-users at lists.osgeo.org
> Subject: Re: [Geomoose-users] debugging mapserver WFS layer search
>
> Hi Karsten,
>
> I'm not sure on this but have a few troubleshooting ideas that might help.
>
> On Fri, Jan 5, 2018 at 7:53 AM, karsten <karsten at terragis.net> wrote:
>>
>> Hi All,
>>
>> I have configured my first Geomoose v 3 pilot project and got all working
> except a MapServer WFS layer search on a PostGIS layer. I am using ms4w v
> 3.2.3  and the app package geomoose 3.1. I have successfully added a
> firestation WFS search to the desktop demo
> http://localhost/gm3/desktop/index.html following  the instructions at
> http://geomoose.github.io/gm3/howto/add-search.html .
>> Now I have used MapServer WMS for many years but this is the first time I
> am using WFS; so am a bit lost of how to debug my own custom layers search
> in Geomoose.
>> In a copy of the desktop app I added my own data and so on but the search
> on one parcel layer I have added (a MapServer WFS layer drawn from PostGIS)
> returns no errors but empty gml results.
>>
>> The request I can see is
>> http://localhost/cgi-bin/mapserv.exe?MAP=c:/data/mapfiles/mechernich.m
>> ap&typename=ms:flurstueck_wfs
>> plus the post params
>> MAP c:/data/mapfiles/mechernich.map
>> typename     ms:flurstueck_wfs
>>
>> <GetFeature xmlns="http://www.opengis.net/wfs" service="WFS"
>> version="1.1.0" outputFormat="text/xml; subtype=gml/2.1.2"
>> xsi:schemaLocation="http://www.opengis.net/wfs
>> http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Query
>> typeName="ms:flurstueck_wfs" srsName="EPSG:4326"><Filter
>> xmlns="http://www.opengis.net/ogc"><PropertyIsLike wildCard="*"
>> singleChar="." escapeChar="!"
>> matchCase="false"><PropertyName>lagebezeichnung</PropertyName><Literal
>> >*Auf*</Literal></PropertyIsLike></Filter></Query></GetFeature>
>>
>>
>> The response gives me an empty bounding box and feature collection (when
> there are many objects that should be found using the string "Auf" - tried
> it with a postgres SQL query that gave me > 2200 results):
>>
>
> You can turn on Postgresql logging to see what query is actually run on
> Postgresql from MapServer/GeoMoose.  Then read the logs and run that query
> via psql or PGAdmin to see what it returns.  That lets you know whether the
> query getting passed in is bad or the correct results are returned and not
> properly handled by MapServer/GeoMoose.
> https://stackoverflow.com/questions/722221/how-to-log-postgresql-queries#722
> 236
>
>
>> <?xml version='1.0' encoding="UTF-8" ?> <wfs:FeatureCollection
>>    xmlns:ms="http://mapserver.gis.umn.edu/mapserver"
>>    xmlns:wfs="http://www.opengis.net/wfs"
>>    xmlns:gml="http://www.opengis.net/gml"
>>    xmlns:ogc="http://www.opengis.net/ogc"
>>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>    xsi:schemaLocation="http://www.opengis.net/wfs
> http://schemas.opengis.net/wfs/1.1.0/WFS-basic.xsd
>>                        http://mapserver.gis.umn.edu/mapserver
> http://localhost/cgi-bin/mapserv?map=C:/data/mapfiles/mechernich.map&SER
> VICE=WFS&VERSION=1.1.0&REQUEST=DescribeFeatureType&TYPENAME=ms:f
> lurstueck_wfs&OUTPUTFORMAT=XMLSCHEMA">
>>    <gml:boundedBy>
>>       <gml:null>missing</gml:null>
>>    </gml:boundedBy>
>> </wfs:FeatureCollection>
>>
>> I have tried to include all that is needed in the mapsertver layers see
> below (even changed the data tag to a sub select to make sure all atributes
> are retrieved for sure ...
>>
>>
>> Would anyone have suggestions how to debug this ?
>>
>> Cheers
>> Karsten
>>
>> Karsten Vennemann
>> Principal
>>
>> Terra GIS LTD
>> www.terragis.net
>>
>>
>> ------------------- in map file  ---------------
>>
>>   LAYER
>>     CONNECTION "dbname='gisme' host=localhost port=5432 user='postgres'
> password='postgres' sslmode=disable"
>>     CONNECTIONTYPE POSTGIS
>>     DATA 'wkb_geometry FROM (select * from
> "public"."gm_ax_flurstueck_geo") as foo USING UNIQUE fid USING srid=25832'
>>     EXTENT 324008.5625 5598582 343287.6875 5614541
>
> Good that you have EXTENT on your PostGIS layer.  That can be required.
>
> Reviewing the mapbook.xml configuration for search might be helpful too.
>
>
> Best regards, Eli
>
>
>>     METADATA
>>       "gml_include_items" "all"
>>       "ows_extent" "324008.5625 5598582.0 343287.6875 5614541.0"
>>       "ows_srs" "EPSG:25832 EPSG:3857 EPSG:900913 EPSG:4326"
>>       "ows_title" "flurstueck_wfs"
>>       "wms_bbox_extended" "true"
>>       "gml_include_items" "all"
>>       "wfs_title"         "flusstuecke_wfs" ##REQUIRED
>>       "gml_featureid"     "ogc_fid" ## REQUIRED
>>       "wfs_enable_request" "*"
>>       'ows_srs' 'EPSG:25832 EPSG:4326 EPSG:3857 EPSG:900913'
>>       'wfs_srs' 'EPSG:25832 EPSG:4326 EPSG:3857 EPSG:900913'
>>       'wms_feature_info_mime_type' 'application/json'
>>    END # METADATA
>>     TEMPLATE 'dummy'
>>     NAME "flurstueck_wfs"
>>     PROJECTION
>>       "init=epsg:25832"
>>     END # PROJECTION
>>     STATUS OFF
>>     TILEITEM "location"
>>     TYPE POLYGON
>>     UNITS METERS
>>     CLASS
>>       NAME "Flurstueck"
>>       STYLE
>>         COLOR 249 250 255
>>         OPACITY 0
>>       END # STYLE
>>       STYLE
>>         OUTLINECOLOR 187 142 142
>>         WIDTH 0.982677
>>       END # STYLE
>>     END # CLASS
>>   END # LAYER
>>
>>
>>
>>
>>
>> _______________________________________________
>> Geomoose-users mailing list
>> Geomoose-users at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/geomoose-users
>


More information about the Geomoose-users mailing list