[mapserver-users] Error with Filter = no results
Rahkonen Jukka (MML)
jukka.rahkonen at maanmittauslaitos.fi
Thu Feb 2 00:33:27 PST 2017
What happens if you remove srsName from the filter? It can be hard to know how to reproject from EPSG:32632 into unknown. WFS 1.0.0 is anyway tied to the default srs. I would also consider saving data into PostGIS with proper SRID.
-Jukka Rahkonen-
----- Alkuperäinen viesti -----
Lähettäjä: "Daniel Hardes" <hardes at 3dis.de>
Lähetetty: 2.2.2017 10:22
Vastaanottaja: "mapserver-users at lists.osgeo.org" <mapserver-users at lists.osgeo.org>
Aihe: [mapserver-users] Error with Filter = no results
Hello,
i have a question with the Filter parameter.
without a filter, mapserver does a normal SQL query like:
select "pkid","set","id","lod","type","source","referencepoint","boundingbox",encode(ST_AsBinary(ST_Force_2D("groundsurface"),'NDR'),'hex') as geom,"id" from building where groundsurface && ST_GeomFromText('POLYGON((691642.41999 5334989.72599,691642.41999 5335172.82301,691979.17301 5335172.82301,691979.17301 5334989.72599,691642.41999 5334989.72599))',-1) limit 101
but if i add an BBox filter, i got a wrong polygon:
select "pkid","set","id","lod","type","source","referencepoint","boundingbox",encode(ST_AsBinary(ST_Force_2D("groundsurface"),'NDR'),'hex') as geom,"id" from building where groundsurface && ST_GeomFromText('POLYGON((-0.999888179649133 -0.999999999990785,-0.999888179649133 -0.999999999990785,-0.999888179649133 -0.999999999990785,-0.999888179649133 -0.999999999990785,-0.999888179649133 -0.999999999990785))',-1) and (st_intersects(groundsurface,ST_GeomFromText('POLYGON ((691813.1405204038600000 5335101.3663145527000000, 691813.1405204038600000 5335921.3585226759000000, 692960.5523786536700000 5335921.3585226759000000, 692960.5523786536700000 5335101.3663145527000000, 691813.1405204038600000 5335101.3663145527000000))',-1)) = TRUE)
... The polygon:
'POLYGON((-0.999888179649133 -0.999999999990785,-0.999888179649133 -0.999999999990785,-0.999888179649133 -0.999999999990785,-0.999888179649133 -0.999999999990785,-0.999888179649133 -0.999999999990785))',-1
is wrong. A normal SQL query without these values, gets my desired result.
My map File:
--------------------------------------------------------------
MAP
NAME "sample"
SIZE 800 400
DEBUG 5
OUTPUTFORMAT
NAME "geojson"
DRIVER "OGR/GEOJSON"
MIMETYPE "application/json; subtype=geojson"
FORMATOPTION "STORAGE=stream"
FORMATOPTION "FORM=SIMPLE"
END
CONFIG MS_ERRORFILE "ms_error.log"
PROJECTION
"init=epsg:32632"
END
WEB
METADATA
ows_enable_request "*"
END
END
LAYER
DEBUG 5
NAME "poly"
STATUS DEFAULT
TYPE POLYGON
METADATA
"wfs_srs" "EPSG:32632"
"wms_transparent" "true"
"wfs_getfeature_formatlist" "geojson"
END
PROJECTION
'init=epsg:32632'
END
CONNECTIONTYPE postgis
CONNECTION "host=localhost port=5432 user=postgres password=xxxxx dbname=map_daniel"
DATA "groundsurface from building using SRID=-1 using unique id"
CLASS
STYLE
COLOR "#88888888"
ANTIALIAS true
END
END
END
END
-------------------------------------------------------------
And the Request:
http://localhost:8081/cgi-bin/mapserv.exe?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&SRSNAME=EPSG:32632&TYPENAMES=poly&COUNT=100&outputformat1=geojson&map=C:\Users\d.hardes\Documents\map.map&Filter=<Filter><BBOX><PropertyName>poly</PropertyName><Box srsName="EPSG:32632"> <coordinates>691813.1405204039,5335101.366314553 692960.5523786537,5335921.358522676</coordinates></Box></BBOX></Filter>
And result
<?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.0.0/WFS-basic.xsd
http://mapserver.gis.umn.edu/mapserver http://localhost:8081/cgi-bin/mapserv.exe?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=poly&OUTPUTFORMAT=XMLSCHEMA">
<gml:boundedBy>
<gml:null>missing</gml:null>
</gml:boundedBy>
</wfs:FeatureCollection>
where is the Error in my settings?
--
Daniel Hardes
Mail: hardes at 3dis.de | Tel.: +49 (0)2861 8919 84
3DIS GmbH
Konrad-Zuse-Straße 6
D - 46397 Bocholt
www.3dis.de
3DIS GmbH | Geschäftsführung: Gerrit Hoven, Andreas Steffens | Amtsgericht Coesfeld | HRB 12986
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3dis_64_126.png
Type: image/png
Size: 5468 bytes
Desc: 3dis_64_126.png
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20170202/18a8cc77/attachment.png>
More information about the MapServer-users
mailing list