TILEINDEX behavior

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Wed Oct 20 17:28:05 EDT 2004


Hi all,

I seem to bang my head against this on a regular basis. Has this been
changed and I'm just stupidly working on an old version (4.01) and
should upgrade?

Relative paths in Tileindexes NEED to be relative to the location of the
Tileindex!

Why? because it is needed to modularize your deployment of data.
I create a directory that has a bunch of data in a sub tree and then
create the tileindexes in that directory. If I want to reference that
directory in a lot of other map configs using symlinks it can get linked
into a different levels in the overall directory structure. If the paths
are relative to the DATAPATH or the mapfile location then is almost
always breaks.

I typically have

All mapfiles are in a common directory like "/u/mapfiles/"
DATAPATH "/u/data/"

TILEINDEX "tiger-maps/roads-tile"

and paths in "roads-tile.shp" are like:
./data/01/001/roads.shp
./data/01/003/roads.shp

and /u/data/tiger-maps/data/01/...


BUT mapserver seems to look for files in:

/u/mapfiles/./data/01/001/roads.shp
/u/data/./data/01/001/roads.shp


tiger-maps might also get referenced in another map like:

/u/data/world/us/tiger-maps -> /u/data/tiger-maps

DATAPATH "/u/data/world/"
TILEINDEX "us/tiger-maps/roads-tile"

This is a natural thing to do with making data and tileindexes reusable,
but it requires the relative paths in tileindexes to be relative to the
tileindex location.

-Steve W.



More information about the mapserver-users mailing list