[mapserver-users] How to use Spatialite as a TILEINDEX

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Tue Sep 6 05:01:51 EDT 2011


Hi,

The mapfile document http://mapserver.org/mapfile/layer.html is a little bit unclear about raster tileindex. It made me believe that shapefile tileindex is the only possibility.

"TILEINDEX<http://mapserver.org/optimization/tileindex.html#tileindex> [filename|layername]
Name of the tileindex file or layer. A tileindex is similar to an ArcInfo library index. The tileindex contains polygon features for each tile. The item that contains the location of the tiled data is given using the TILEITEM parameter. When a file is used as the tileindex for shapefile or raster layers, the tileindex should be a shapefile. For CONNECTIONTYPE OGR layers, any OGR supported datasource can be a tileindex. Normally the location should contain the path to the tile file relative to the shapepath, not relative to the tileindex itself. If the DATA parameter contains a value then it is added to the end of the location. When a tileindex layer is used, it works similarly to directly referring to a file, but any supported feature source can be used (ie. postgres, oracle)."

However, I remembered vaguely that I had read something about storing tileindex in PostGIS (perhaps it was Armin). After reading old mails and a few trials and errors I managed to use Spatialite as a tileindex. Only after that I understood that the "layername" and "timeindex layer" mean the name of another layer in the mapfile. and found this document http://mapserver.org/ogc/wms_time.html#example-of-wms-t-with-postgis-tile-index-for-raster-imagery

An example like this somewhere linked with the tileindex item in the documentation could save some time for others.

LAYER
        NAME "MS_tileindex_layer"
        TYPE POLYGON
        CONNECTIONTYPE OGR
        CONNECTION "tileindex.sqlite"
        DATA "Spatialite_tileindex_layer"
    END

LAYER
        NAME "raster_layer"
        STATUS ON
        TYPE RASTER
        TILEINDEX "MS_tileindex_layer"
        ...

Side effect with using the tileindex layer is that it will be included in the WMS layers but obviously there is no way to hide it.

-Jukka Rahkonen-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110906/4af0f9c2/attachment.html


More information about the mapserver-users mailing list