mixed geometries in MapServer / PostGIS

Alexander Mayrhofer axelm-mapserver at NONA.NET
Thu Sep 8 02:43:18 EDT 2005


Hi,

i'm currently planning a mapserver application which involves several types
of geometries (point, line, multiline, poly, multipoly features) to be held
in a postgis database. This database would allow users to upload, manage and
  classify features.

Those different types of features would be distributed among several layers
(features would probably even be moved between layers with updates to the
database), and the number of layers is not fixed as users would be allowed
to create new layers by themselves.

So, what i'm thinking about to do now is either:

- 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 ;) ]

- Hold features of the same geometry type in the same table (a "point",
"line", "multiline" table etc.) and use queries to seperate layers.

- Hold each and every layer in a new table, and dynamically create tables as
they are needed.

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'd greatly appreciate any insight from fellow list members on this topic.

Thanks,

Alex Mayrhofer
http://nona.net/features/map/



More information about the mapserver-users mailing list