When using data like MapInfo TAB files MapServer's current behavior is turning
(multi)polygons and (multi)linestrings into multiple points in POINT layers and
turning (multi)polygons into multiple linestrings in LINE layers.
This is a "feature" that was there for shapefiles even before OGR connections
were added to MapServer.
But when using data with mixed geometry types like TAB or DGN this is no desired
behaviour.
Current workarounds are:
- Editing the data outside MapServer and splitting up data by geometry type
before using it in MapServer. This means editing the source data which is not
desired and/or always possible.
- Using query statements through the DATA key. Only possible when you have an
attribute which discriminates the different geomtery types.
So it would be a nice enhancement to have a mechanism to filter OGR connections
by geometry type, maybe something like a GEOMETRYTYPE filter?
In the present situation a TAB file with POLYGON, LINESTRING and POINT data
displays the points from LINESTRINGS and POLYGONS too if using a TYPE POINT
layer in MapServer (gives an error when MULTIPOLYGONS are present in the
dataset. This will be solved in MapServer 4.5, see bug 1124):
NAME bis_his
TYPE POINT
CONNECTIONTYPE OGR
CONNECTION "bis_his.tab"
Workaround with a query (bad workaround because it is not generic, not always
possible when a discriminating attribute lacks and it uses an alphanumeric
attribute instead of the real geometrytype)
NAME bis_his
TYPE POINT
CONNECTIONTYPE OGR
CONNECTION "bis_his.tab"
DATA "SELECT * FROM bis_his WHERE Opmerking LIKE 'C%'"
Possible future situation:
NAME bis_his
TYPE POINT
CONNECTIONTYPE OGR
CONNECTION "bis_his.tab"
GEOMETRYTYPE POINT
GEOMETRYTYPE should offer all possibilities available in OGR like MULTIPOLYGON,
POLYGON, MULTILINESTRING, LINESTRING, POINT etc. and restrict the data shown to
only that geometry type and not use lines from polygons in a TYPE LINE layer or
points from polygons and linestrings in a TYPE POINT layer.
I would like to know what efforts are needed to implement such a GEOMETRYTYPE
feature for OGR data in MapServer.