[Geomoose-users] debugging mapserver WFS layer search

Eli Adam eadam at co.lincoln.or.us
Fri Jan 5 09:08:02 PST 2018


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.map&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#722236


> <?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&SERVICE=WFS&VERSION=1.1.0&REQUEST=DescribeFeatureType&TYPENAME=ms:flurstueck_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