<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>GeoRaster --- Oracle Spatial GeoRaster</title> <meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8"> <meta name="GENERATOR" content="OpenOffice.org 2.4 (Linux)"> <style type="text/css"> <!-- @page { size: 8.5in 11in; margin: 0.79in } P { margin-bottom: 0.08in } --></style> </head> <body bgcolor="#ffffff"> <h1>Oracle Spatial GeoRaster</h1> <p> This driver supports reading and writing raster data in Oracle Spatial GeoRaster format (10g or later). The Oracle Spatial GeoRaster driver is optionally built as a GDAL plugin, but it requires Oracle client libraries. </p> <p> When opening a GeoRaster, it's name should be specified in the form: </p> <p style="font-family: Courier New,Courier,monospace; margin-left: 40px;"> georaster:<user>{,/}<pwd>{,@}[db],[table],[column],[where]<br> georaster:<user>{,/}<pwd>{,@}[db],<rdt>,<rid></p> <p>Where:</p> <p style="font-family: Courier New,Courier,monospace; margin-left: 40px;"> user = Oracle server user's name login<br> pwd = user password<br> db = Oracle server identification (database name)<br> table = name of a GeoRaster table (table that contains GeoRaster columns)<br> column = name of a column data type MDSYS.SDO_GEORASTER<br> where = a simple where clause to identify one or multiples GeoRaster<br> rdt = name of a raster data table<br> rid = numeric identification of one GeoRaster</p> <p>Examples:</p> <p style="font-family: Courier New,Courier,monospace; margin-left: 40px;">geor:scott,tiger,demodb,table,column,id=1<br> geor:scott,tiger,demodb,table,column,"id = 1"<br> "georaster:scott/tiger@demodb,table,column,gain>10"<br> "georaster:scott/tiger@demodb,table,column,city='Brasilia'"<br> georaster:scott,tiger,,rdt_10$,10<br> geor:scott/tiger,,rdt_10$,10</p> <p>Note: do note use space around the field values and the commas.</p> <h3>Browsing the database for GeoRasters <br> </h3> <p>By providing some basic information the GeoRaster driver is capable of listing the existing rasters stored on the server:</p> To list all the GeoRaster table on the server that belongs to that user name and database: <p style="margin-left: 40px;"><font face="Courier, monospace">% gdalinfo georasters:scott/tiger@db1</font></p> To list all the GeoRaster type columns that exist in that table:<br> <div style="margin-left: 40px;"><font face="Courier, monospace">% gdalinfo georasters:scott/tiger@db1,table_name</font></div> <p>That will list all the GeoRaster objects stored in that table. </p> <div style="margin-left: 40px;"><font face="Courier, monospace">% gdalinfo georasters:scott/tiger@db1,table_name,georaster_column</font></div> <p>That will list all the GeoRaster existing on that table according to a Where clause. </p> <div style="margin-left: 40px;"><font face="Courier, monospace">% gdalinfo georasters:scott/tiger@db1,table_name,georaster_column,city='Brasilia'</font></div> <br> Note that the result of those queries are returned as GDAL metadata sub-datasets, e.g.: <p style="margin-left: 40px;"><font face="Courier, monospace">% gdalinfo georaster:scott/tiger<br> Driver: GeoRaster/Oracle Spatial GeoRaster<br> Subdatasets:</font><br> <span style="background: transparent none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><font face="Courier, monospace"> SUBDATASET_1_NAME=georaster:scott,tiger,,LANDSAT<br> SUBDATASET_1_DESC=Table:LANDSAT<br> SUBDATASET_2_NAME=georaster:scott,tiger,,GDAL_IMPORT<br> SUBDATASET_2_DESC=Table:GDAL_IMPORT</font></span></p> <h3>Creation Options</h3> <ul> <li><strong>BLOCKXSIZE</strong>: The number of pixel columns on raster block. </li> <li> <strong>BLOCKYSIZE</strong>: The number of pixel rows on raster block. </li> <li> <strong>BLOCKBSIZE</strong>: The number of bands on raster block.</li> <li><span style="font-weight: bold;">SRID</span>: Assign a specific EPSG projection/reference system identification to the GeoRaster.</li> <li><strong>INTERLEAVE</strong>: Band interleaving mode, BAND, LINE, PIXEL (or BSQ, BIP, BIL) for band sequential, Line or Pixel interleaving. </li> <li><strong>DESCRIPTION</strong>: A simple description of a newly created table in SQL syntax. If the table already exist, this create option will be ignored, e.g.:</li> </ul> <span style="font-family: Courier New,Courier,monospace;">% gdal_translate -of georaster landsat_823.tif geor:scott/tiger@orcl,landsat,raster \<br> -co DESCRIPTION="(ID NUMBER, NAME VARCHAR2(40), RASTER MDSYS.SDO_GEORASTER)" \<br> -co INSERT="VALUES (1,'Scene 823',</span><span style="font-family: Courier New,Courier,monospace;"></span><span style="font-family: Courier New,Courier,monospace;">SDO_GEOR.INIT()</span><span style="font-family: Courier New,Courier,monospace;"></span><span style="font-family: Courier New,Courier,monospace;">)"</span> <ul> <li><strong>INSERT</strong>: A simple SQL insert/values clause to inform the driver what values to fill up when inserting a new row on the table, e.g.:</li> </ul> <span style="font-family: Courier New,Courier,monospace;">% gdal_translate -of georaster landsat_825.tif geor:scott/tiger@orcl,landsat,raster \<br> -co INSERT="ID, RASTER VALUES (2,</span><span style="font-family: Courier New,Courier,monospace;"></span><span style="font-family: Courier New,Courier,monospace;">SDO_GEOR.INIT()</span><span style="font-family: Courier New,Courier,monospace;"></span><span style="font-family: Courier New,Courier,monospace;">)"</span><br> <ul> <li><strong>COMPRESS</strong>: Compression options, JPEG-F, JPEG-B, DEFLATE or NONE. The two JPEG options are lossy, meaning that the original pixel values are changed. The JPEG-F store a full JPEG structure on each block while JPEG-B are smaller since they don't store Huffman and Quantization tables.</li> <li><span style="font-weight: bold;">QUALITY</span>: Quality compression option for JPEG ranging from 0 to 100. The default is 75.</li> <li><span style="font-weight: bold;">NBITS</span>: Sub byte data type, options: 1, 2 or 4.</li> </ul> <strong></strong> <h3>Importing GeoRaster</h3> <p style="margin-bottom: 0in;">During the process of importing raster into a GeoRaster object it is possible to give the driver a simple SQL table definition and also a SQL insert/values clause to inform the driver about the table to be created and the values to be added to the newly created row. The following example does that:</p> <p style="margin-bottom: 0in;"><font face="Courier, monospace">% gdal_translate -of georaster landsat_1.tif georaster:scott/tiger,,landsat,scene \<br> -co "DESCRIPTION=(ID NUMBER, SITE VARCHAR2(45), SCENE MDSYS.SDO_GEORASTER)" \<br> -co "INSERT=VALUES(1,'West fields', </font><span style="font-family: Courier New,Courier,monospace;">SDO_GEOR.INIT()</span><font face="Courier, monospace">)"</font></p> <p style="margin-bottom: 0in;">Note that the create option DESCRIPTION requires to inform table name (in bold). And column name (underlined) should match the description:</p> <p style="margin-bottom: 0in;"><font face="Courier, monospace">% gdal_translate -of georaster landsat_1.tif georaster:scott/tiger,,<span style="font-weight: bold;">landsat</span>,<span style="text-decoration: underline;">scene</span> \<br> -co "DESCRIPTION=(ID NUMBER, SITE VARCHAR2(45), <span style="text-decoration: underline;">SCENE</span> MDSYS.SDO_GEORASTER)" \<br> -co "INSERT=VALUES(1,'West fields', </font><span style="font-family: Courier New,Courier,monospace;">SDO_GEOR.INIT()</span><font face="Courier, monospace">)"</font></p> <p style="margin-bottom: 0in;">If the table "landsat" exist, the option "DESCRIPTION" is ignored. The driver can only update one GeoRaster column per run of gdal_translate. Oracle create default names and values for RDT and RID during the initialization of the SDO_GEORASTER object but user are also able to specify a name and value of their choice.</p> <p style="margin-bottom: 0in;"><font face="Courier, monospace">% gdal_translate -of georaster landsat_1.tif georaster:scott/tiger,,landsat,scene \<br> -co "INSERT=VALUES(10,'Main building', </font><span style="font-family: Courier New,Courier,monospace;">SDO_GEOR.INIT("RDT", 10)</span><font face="Courier, monospace">)"</font></p> <p style="margin-bottom: 0in;">If no information is given about where to store the raster the driver will create (if doesn't exist already) a default table named GDAL_IMPORT with just one GeoRaster column named RASTER, example:</p> <p style="margin-bottom: 0in;"><font face="Courier, monospace">% gdal_translate -of georaster input.tif “geor:scott/tiger@dbdemo”</font><br> </p> <h3>Exporting GeoRaster</h3> A GeoRaster can be identified by a Where clause or by a pair of RDT & RID:<br> <br> <span style="font-family: Courier New,Courier,monospace;">% gdal_translate -of gtiff geor:scott/tiger@dbdemo,landsat,scene,id=54 output.tif<br> </span><span style="font-family: Courier New,Courier,monospace;">% gdal_translate -of gtiff geor:scott/tiger@dbdemo,st_rdt_1,130 output.tif<br> </span> <h3>General use of GeoRaster</h3> GeoRaster can be used in any GDAL command line tool with all the available options. Like a image subset extraction of re-project:<br> <br> <span style="font-family: Courier New,Courier,monospace;">% gdal_translate -of gtiff geor:scott/tiger@dbdemo,landsat,scene,id=54 output.tif \<br> -srcwin 0 0 800 600<br> <br> </span><span style="font-family: Courier New,Courier,monospace;">% gdalwarp -of png geor:scott/tiger@dbdemo,st_rdt_1,130 output.png -t_srs EPSG:9000913<br> <br> </span>Two different GeoRaster can be used as input and output on the same operation:<br> <br> <span style="font-family: Courier New,Courier,monospace;">% gdal_translate -of georaster geor:scott/tiger@dbdemo,landsat,scene,id=54 geor:scott/tiger@proj1,projview,image -co INSERT="VALUES (102, </span><span style="font-family: Courier New,Courier,monospace;">SDO_GEOR.INIT()</span><span style="font-family: Courier New,Courier,monospace;">)"<br> <br> </span> Applications that use GDAL can theoretically read and write from GeoRaster just like any other format but most of then are more inclined to try to access files on the file system so one alternative is to create VRT to represent the GeoRaster description, e.g.:<br> <br> <span style="font-family: Courier New,Courier,monospace;">% gdal_translate -of VRT geor:scott/tiger@dbdemo,landsat,scene,id=54 view_54.vrt<br> % openenv view_54.vrt<br> <br> </span><span style="font-family: Courier New,Courier,monospace;"></span><br> <h3></h3> </body> </html>