[Mapserver-users] Abstract TILEINDEX attribute to support any vector format?

Homme Zwaagstra hrz at geodata.soton.ac.uk
Thu Mar 18 07:50:12 PST 2004


Dear All,

As I understand it the TILEINDEX attribute of a layer object can only
refer to a shapefile. I'm involved in building a mapscript application
that, from an architectural perspective, would benefit from being able
to specify a tileindex held in a postgis datasource. Is this an
enhancement worth pursuing or are there practical limitations that
would make it undesirable?

I'm imagining a situation where the datasource for the tileindex is
abstracted to enable any vector datasource supported by mapserver to
be used. Conceptually this could be achieved by creating a TILEINDEX
object within a layer that supports the standard connection attributes:

TILEINDEX
    TILEITEM "Location"
    CONNECTIONTYPE postgis
    CONNECTION "user=me password=secret dbname=mapserver host=localhost"
    DATA "polygon from tileindex"
END

In a separate but related vein connections to non-shapefile data
sources currently need to be repeated for each layer, even if they
refer to the same source. I often find, for example, that the
CONNECTION strings and CONNECTIONTYPEs for my layers refer to the same
postgis database. This can lead to errors and overhead when the
connection changes. Being able to specify the application's
datasources (one or more) in the map object seems to make more sense
to me. Something like:

DATASOURCE
    NAME default
	SHAPEPATH "/path/to/data"
END

DATASOURCE
	NAME postgis_1
    CONNECTIONTYPE postgis
    CONNECTION "user=me password=secret dbname=mapserver host=localhost"
END

Then in each layer we only need to specify the data source name. The
DATA attribute would remain the same:

DATASOURCE postgis_1
DATA "the_geom from my_table"

Some mechanism for specifying the default datasource could be
provided, such as the first DATASOURCE in the mapfile, or more
explicity (e.g. with attributes). If a layer does not specify a
DATASOURCE attribute then it could be assumed to be from the default
datasource. This would make upgrading mapfiles to a new syntax less
trouble.

Thoughts?

Kind regards,

Homme Zwaagstra



More information about the MapServer-users mailing list