Raster tile indexing in PostGIS

Frank Warmerdam warmerdam at POBOX.COM
Wed Nov 22 09:59:18 EST 2006


Thy, Kristian wrote:
> Quoting the Raster Data Access HOWTO
> <http://mapserver.gis.umn.edu/docs/howto/raster_data>:
> 
> "The list of files forming a layer can be stored in a shapefile with
> polygons
>  representing the footprint of each file, and the name of the files.
> This is
>  called a TILEINDEX ..."
> 
> The tileindex, we're told, is defined in the map file like this:
> 
> LAYER
>   NAME "hpool"
>   STATUS ON
>   TILEINDEX "hp2.shp"
>   TILEITEM "Location"
>   TYPE RASTER
> END
> 
> My question is then: Is it possible (and if yes, desirable) to read the
> tileindex from a PostGIS data source instead of a shapefile - i.e. use
> gdatindex to create the tileindex, then convert the index .shp using
> shp2pgsql and stuff it into PostGIS. My understanding is that using
> plain ole shapefiles you miss out on the gist indexing and thus suffer
> a performance loss.

Kristian,

Yes, you can also use another layer as the tileindex by putting a layer
name in the TILEINDEX keyword instead of the name of a shapefile.  In
case of conflict a layer with a matching name would be used ahead of a
shapefile.

Normally the layer should be of type POLYGON and can be a connection to
any feature data store, including postgis.

The TILEITEM is still used to give the name of the column with the path
in it.  For the most part things work similarly to a shapefile.  In fact,
internally I believe the code creates a temporary layer for the direct
shapefile tileindex access anyways.

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    | President OSGeo, http://osgeo.org



More information about the mapserver-users mailing list