mixed geometries in MapServer / PostGIS

Frank Warmerdam fwarmerdam at GMAIL.COM
Thu Sep 8 10:29:04 EDT 2005


On 9/8/05, Alexander Mayrhofer <axelm-mapserver at nona.net> wrote:
> - Hold each and every feature in a single table featuring a generic
> "geometry" column, and use queries to seperate feature types and layers
> (using eg. a "layername" column). Question related to this: Does Mapserver
> cope with mixed geometry tables, or do i need to "pre-filter" the results in
> the queries? [ok, could try that out ;) ]

Alexander, 

MapServer layer types determine the type of geometry they want.

The mappostgis.c code seems to try and force features to the 
type required for the layer. So, for instance,  if the layer type is 
LINE, mappostgis will force all polygons into linestrings (the edges).
But point features are not translatable. 

The OGR provider similarly tries to force geometry to the expected
type. 

I'm not too sure what happens to the features that don't translate
though (ie. point features used in a line layer). 

> I tend to prefer the second solution - that would involve a static set of
> tables. On the other hand, filtering by a spatial index _plus_ a column may
> be inefficient postgis-wise if huge numbers of layers are involved in a
> single table (postgres might decide to ignore the spatial index and go for
> the layertype column index only - shriek!)

I would be very concerned about efficient query if you will end
up dealing with large data volumes.  I'm not sure what is the best
approach though.
 
Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the mapserver-users mailing list