.

Oracle Spatial GeoRaster Plugin

In Oracle databases, raster data can be stored in SDO_GEORASTER objects available with the Oracle Spatial extension. In QGIS, the oracle_raster Oracle Spatial GeoRaster plugin is supported by GDAL and depends on Oracle’s database product being installed and working on your machine. While Oracle is proprietary software, they provide their software free for development and testing purposes. Here is one simple example of how to load raster images to GeoRaster:

$ gdal_translate -of georaster input_file.tif geor:scott/tiger@orcl

Isto irá carregar o raster para a tabela padrão GDAL_IMPORT table, como coluna designada de RASTER.

Gerindo ligações

Firstly, the Oracle GeoRaster Plugin must be enabled using the Plugin Manager (see The Plugins Menus). The first time you load a GeoRaster in QGIS, you must create a connection to the Oracle database that contains the data. To do this, begin by clicking on the oracle_raster Add Oracle GeoRaster Layer toolbar button – this will open the Select Oracle Spatial GeoRaster dialog window. Click on [New] to open the dialog window, and specify the connection parameters (See Figure_oracle_raster_1):

  • Name: Enter a name for the database connection.
  • Database instance: Enter the name of the database that you will connect to.
  • Username: Specify your own username that you will use to access the database.
  • Password: Provide the password associated with your username that is required to access the database.

Figure Oracle Raster 1:

../../../_images/oracle_create_dialog.png

Janela de Criação de Ligação Oracle

Agora, volte à janela principal Oracle Spatial GeoRaster (veja Figure_oracle_raster_2), use a lista drop-down para escolher uma ligação, e use o botão [Ligar] para estabelecer a ligação. Pode também [Editar] a ligação, abrindo a janela anterior e efectuar alterações na informação da ligação, ou usar o botão [Apagar] para remover a ligação da lista drop-down.

Seleccionando um GeoRaster

Once a connection has been established, the subdatasets window will show the names of all the tables that contain GeoRaster columns in that database in the format of a GDAL subdataset name.

Clique num dos subconjuntos de dados listados e de seguida clique em [Seleccionar] para escolher o nome da tabela. Agora, outra lista de subconjunto de dados irá mostrar os nomes das colunas GeoRaster nessa tabela. Geralmente costuma ser uma lista pequena, uma vez que a maioria dos utilizadores não irá ter mais de um ou duas colunas GeoRaster na mesma tabela.

Click on one of the listed subdatasets and then click on [Select] to choose one of the table/column combinations. The dialog will now show all the rows that contain GeoRaster objects. Note that the subdataset list will now show the Raster Data Table and Raster Id pairs.

At any time, the selection entry can be edited in order to go directly to a known GeoRaster or to go back to the beginning and select another table name.

Figure Oracle Raster 2:

../../../_images/oracle_select_dialog.png

Janela de Selecção Oracle GeoRaster

The selection data entry can also be used to enter a WHERE clause at the end of the identification string (e.g., geor:scott/tiger@orcl,gdal_import,raster,geoid=). See http://www.gdal.org/frmt_georaster.html for more information.

Exibindo o GeoRaster

Finally, by selecting a GeoRaster from the list of Raster Data Tables and Raster Ids, the raster image will be loaded into QGIS.

The Select Oracle Spatial GeoRaster dialog can be closed now and the next time it opens, it will keep the same connection and will show the same previous list of subdatasets, making it very easy to open up another image from the same context.

Note

GeoRasters that contain pyramids will display much faster, but the pyramids need to be generated outside of QGIS using Oracle PL/SQL or gdaladdo.

The following is an example using gdaladdo:

gdaladdo georaster:scott/tiger@orcl,georaster\_table,georaster,georid=6 -r
nearest 2 4 6 8 16 32

Este é um exemplo usando PL/SQL:

$ sqlplus scott/tiger
SQL> DECLARE
 gr sdo_georaster;
BEGIN
    SELECT image INTO gr FROM cities WHERE id = 1 FOR UPDATE;
    sdo_geor.generatePyramid(gr, 'rLevel=5, resampling=NN');
    UPDATE cities SET image = gr WHERE id = 1;
    COMMIT;
END;