13.07.2013 Views

PostGIS Raster : Extending PostgreSQL for The Support of ... - CoDE

PostGIS Raster : Extending PostgreSQL for The Support of ... - CoDE

PostGIS Raster : Extending PostgreSQL for The Support of ... - CoDE

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Figure 3.5: Oracle Geo<strong>Raster</strong> georeference approach [14].<br />

Figure 3.6: <strong>PostGIS</strong> <strong>Raster</strong> georeference approach [14].<br />

referred to as storing out-database raster. With the second method, web or desktop applications may<br />

access out-database rasters directly from the filesystem (such as JPEG files) and use most transparently<br />

<strong>PostGIS</strong> <strong>Raster</strong> operators and functions on those rasters.<br />

3.2.3 Indexing<br />

<strong>The</strong> most important index is created on a Geo<strong>Raster</strong> object is a spatial index on the spatial extent<br />

geometry <strong>of</strong> the Geo<strong>Raster</strong> object. Oracle Geo<strong>Raster</strong> creates spatial indexes over the footprint <strong>of</strong> raster<br />

data while <strong>PostGIS</strong> <strong>Raster</strong> creates GiST indexes over the raster data itself. In Oracle Geo<strong>Raster</strong>,<br />

spatial operations (like intersection) can only be done with the MBR <strong>of</strong> the data as the indexes are<br />

created over the spatial extent. In <strong>PostGIS</strong> <strong>Raster</strong>, user can do really complex operations with raster<br />

data like getting a set <strong>of</strong> geometry and geometry value from a given raster band (ST_DumAsPolygons()<br />

function). <strong>The</strong>n, creating indexes over these raster data has more sense [15].<br />

<strong>PostGIS</strong> <strong>Raster</strong> uses GDAL driver to calculate the georeferenced coordinates <strong>for</strong> upper and lower<br />

corners (the spatial extent or footprint) <strong>of</strong> a raster. In this case, its spatial extent is the enclosing<br />

geometry. Nervertheless, this is not necessarily in this way <strong>for</strong> Oracle Geo<strong>Raster</strong>.<br />

In Geo<strong>Raster</strong>, one <strong>of</strong> the prerequisites <strong>for</strong> creating a spatial index over a geometry column is<br />

that the USER_SDO_GEOM_METADATA view must contain an entry with the dimensions and coordinate<br />

boundary in<strong>for</strong>mation <strong>for</strong> the table column to be spatially indexed. So the following code will create<br />

spatial index on the spatial extent geometry <strong>of</strong> the Geo<strong>Raster</strong> objects stored in table spain_images:<br />

DELETE FROM user_sdo_geom_metadata<br />

WHERE table_name = ’spain_images’<br />

AND column_name = ’IMAGE.SPATIALEXTENT’;<br />

INSERT INTO user_sdo_geom_metadata<br />

VALUES (’spain_images’,’IMAGE.SPATIALEXTENT’,<br />

SDO_DIM_ARRAY(SDO_DIM_ELEMENT(’X’, -180, 180, .00000005),<br />

SDO_DIM_ELEMENT(’Y’, -90, 90, .00000005)), 4326);<br />

23

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!