[mapserver-users] Generic geometry type in WFS

Even Rouault even.rouault at spatialys.com
Mon Dec 19 08:11:51 PST 2016


Hi,

> 
> I read from http://mapserver.org/ogc/wfs_server.html this comment:
> 
> "WFS spec. seems to require that features of a given feature type must all
> be of the same geometry type (point, line, polygon). This works fine for
> shapefiles, but some data source formats supported by MapServer allow mixed
> geometry types in a single layer and this goes against the WFS spec.
> Suggestions on how to handle this are welcome (send suggestions to the
> mapserver-dev mailing list."
> 
> Without seeing a reliable reference I do not quite believe that mixed
> geometries are not allowed.

Yes, that statement is really weird and IMHO wrong. The WFS spec doesn't care at all about a 
concept of layer geometry type.

> Geoserver and probably also ArcGIS server
> handle this case by advertising unknown/mixed geometries as
> type='gml:GeometryPropertyType'
> 
> The metadata item gml_[geometry name]_type could have one more option
> "geometry" in addition to the documented list point
>     multipoint
>     line
>     multiline
>     polygon
>     multipolygon

Another thing is that MapServer requires a precise geometry type (the TYPE keyword of a 
LAYER) to be declared, mostly for the needs of rasterization. The WFS server code doesn't 
really care about the value, except that it must be defined to one of POINT, LINE or 
POLYGON so as to check this is really a vector layer. But if your datasource is a mix of 
geometries, that should mostly work, except some tuning in the gmlWriteGeometry_GMLx 
functions though. So indeed we could imagine exposing a generic "geometry" type, although 
it is not clear how useful this would be.

> 
> The list makes me think that don't we support GeometryCollections?

Nope, and this would be harder since the mapserver shape object doesn't handle those. And 
this is a even more esoteric use case.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20161219/42595b6e/attachment.htm>


More information about the MapServer-users mailing list