Changes between Initial Version and Version 1 of DatabaseTileIndex


Ignore:
Timestamp:
Dec 13, 2011, 11:02:00 AM (10 years ago)
Author:
msmitherdc
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DatabaseTileIndex

    v1 v1  
     1To deal with multiple rasters loaded to a table in a database (can be PostGIS or Oracle, example is Oracle), you can use a TILEINDEX in MapServer.
     2
     3Database TILEINDEXes are a little odd in MapServer, they require 2 separate layers, a TILEINDEX layer and a RASTER layer that refers to the TILEINDEX layer.
     4
     5In Oracle, you'll want to create the TILEINDEX as a view to the GEORASTER table of interest.
     6
     7{{{create or replace view my_raster_tindex as select some_attribute, 'geor: user/pass@tns, raster_table_DATA,'||r.raster.rasterid location, R.RASTER.spatialextent shape from rasters_table r;}}}
     8
     9This view will then be used for the TILEINDEX layer
     10
     11{{{
     12LAYER
     13  name raster_tindex
     14  TYPE polygon
     15  PROJECTION
     16    "init=epsg:xxxx"
     17  END
     18  CONNECTIONTYPE ORACLESPATIAL
     19  CONNECTION user/pass@tns'
     20  DATA "shape from my_raster_tindex using srid xxxx"
     21END
     22}}}
     23
     24Then you add a second layer that is the actual RASTER layer
     25
     26{{{
     27LAYER
     28  name db_raster_layer
     29  TYPE RASTER
     30  PROJECTION
     31    "init=epsg:xxxx"
     32  END
     33  TILEINDEX "raster_tindex"   #THIS NAME MUST MATCH THE TILEINDEX LAYER NAME
     34  TILEITEM "location"   #not actually needed if column is named location
     35  STATUS OFF
     36  OFFSITE 0 0 0
     37END
     38}}}
     39
     40One last piece that is needed is to set the SHAPEPATH to null so that the paths to the raster files are treated as database connections and not files.
     41
     42Add
     43{{{
     44SHAPEPATH ""
     45}}}