[Geomoose-users] debugging mapserver WFS layer search
karsten
karsten at terragis.net
Fri Jan 5 09:05:34 PST 2018
I am not sure I got any closer to solving this but at least figured out some
things about MapServer WFS testing.
So I verified the get capabilities works:
http://localhost/cgi-bin/mapserv.exe?MAP=c:/data/mapfiles/mechernich.map
<http://localhost/cgi-bin/mapserv.exe?MAP=c:/data/mapfiles/mechernich.map&SE
RVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities>
&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities
I can get list of all features of the parcel layer I am trying to query
<http://localhost/cgi-bin/mapserv.exe?MAP=c:/data/mapfiles/mechernich.map&ty
pename=ms:flurstueck_wfs&request=GetFeature&service=WFS&version=1.0.0>
http://localhost/cgi-bin/mapserv.exe?MAP=c:/data/mapfiles/mechernich.map&typ
ename=ms:flurstueck_wfs&request=GetFeature&service=WFS&version=1.0.0
This is the request of the desktop query on forestations that is working
with filter
<http://localhost/cgi-bin/mapserv.exe?MAP=/ms4w/apps/gm3-demo-data/demo/fire
stations/firestations.map&typename=ms:fire_stations&request=GetFeature&servi
ce=WFS&version=1.0.0&Filter=<Filter><PropertyIsLike>
http://localhost/cgi-bin/mapserv.exe?MAP=/ms4w/apps/gm3-demo-data/demo/fires
tations/firestations.map&typename=ms:fire_stations&request=GetFeature&servic
e=WFS&version=1.0.0&Filter=<Filter><PropertyIsLike wildcard='*'
singleChar='.'
escape='!'><PropertyName>Dak_GIS__4</PropertyName><Literal>*Eagan*</Literal>
</PropertyIsLike></Filter>
Now for my custom parcel layer I tried two queries one as the original query
on a characters string as this
<http://localhost/cgi-bin/mapserv.exe?MAP=c:/data/mapfiles/mechernich.map&ty
pename=ms:flurstueck_wfs&request=GetFeature&service=WFS&version=1.0.0&Filter
=<Filter><PropertyIsLike>
http://localhost/cgi-bin/mapserv.exe?MAP=c:/data/mapfiles/mechernich.map&typ
ename=ms:flurstueck_wfs&request=GetFeature&service=WFS&version=1.0.0&Filter=
<Filter><PropertyIsLike wildcard='*' singleChar='.'
escape='!'><PropertyName>lagebezeichnung</PropertyName><Literal>Himmelberg</
Literal></PropertyIsLike></Filter>
and I tried one to query an integer field with an existing number
<http://localhost/cgi-bin/mapserv.exe?MAP=c:/data/mapfiles/mechernich.map&ty
pename=ms:flurstueck_wfs&request=GetFeature&service=WFS&version=1.0.0&Filter
=<Filter><PropertyIsEqualTo><PropertyName>flurnummer</PropertyName><Literal>
5790</Literal></PropertyIsEqualTo></Filter>
http://localhost/cgi-bin/mapserv.exe?MAP=c:/data/mapfiles/mechernich.map&typ
ename=ms:flurstueck_wfs&request=GetFeature&service=WFS&version=1.0.0&Filter=
<Filter><PropertyIsEqualTo><PropertyName>flurnummer</PropertyName><Literal>5
790</Literal></PropertyIsEqualTo></Filter>
Both values exist but both queries above give me an empty response
Any ideas what I can try to fix this ?
At this point seems to be a MapServer issue ...
Cheers
Karsten
_____
From: karsten [mailto:karsten at terragis.net]
Sent: Freitag, 5. Januar 2018 16:53
To: 'geomoose-users at lists.osgeo.org'
Subject: debugging mapserver WFS layer search
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>
http://localhost/gm3/desktop/index.html following the instructions at
<http://geomoose.github.io/gm3/howto/add-search.html>
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
<http://localhost/cgi-bin/mapserv.exe?MAP=c:/data/mapfiles/mechernich.map&ty
pename=ms:flurstueck_wfs> &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> 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://www.opengis.net/wfs
<http://schemas.opengis.net/wfs/1.1.0/wfs.xsd>
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" xmlns:xsi="
<http://www.w3.org/2001/XMLSchema-instance>
http://www.w3.org/2001/XMLSchema-instance"><Query
typeName="ms:flurstueck_wfs" srsName="EPSG:4326"><Filter xmlns="
<http://www.opengis.net/ogc> 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):
<?xml version='1.0' encoding="UTF-8" ?>
<wfs:FeatureCollection
xmlns:ms=" <http://mapserver.gis.umn.edu/mapserver>
http://mapserver.gis.umn.edu/mapserver"
xmlns:wfs=" <http://www.opengis.net/wfs> http://www.opengis.net/wfs"
xmlns:gml=" <http://www.opengis.net/gml> http://www.opengis.net/gml"
xmlns:ogc=" <http://www.opengis.net/ogc> http://www.opengis.net/ogc"
xmlns:xsi=" <http://www.w3.org/2001/XMLSchema-instance>
http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=" <http://www.opengis.net/wfs>
http://www.opengis.net/wfs
<http://schemas.opengis.net/wfs/1.1.0/WFS-basic.xsd>
http://schemas.opengis.net/wfs/1.1.0/WFS-basic.xsd
<http://mapserver.gis.umn.edu/mapserver>
http://mapserver.gis.umn.edu/mapserver
<http://localhost/cgi-bin/mapserv?map=C:/data/mapfiles/mechernich.map&SE
RVICE=WFS&VERSION=1.1.0&REQUEST=DescribeFeatureType&TYPENAME=ms:
flurstueck_wfs&OUTPUTFORMAT=XMLSCHEMA>
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
<http://www.terragis.net> 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
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geomoose-users/attachments/20180105/53d86617/attachment-0001.html>
More information about the Geomoose-users
mailing list