「Plugins oracle raster」の版間の差分

提供: OSGeo.JP Wiki
移動: 案内検索
(タグ・画像調整前に一旦配下を統合)
(タグ一括置換状態で一旦保存)
行1: 行1:
<H2>
+
=== Oracle GeoRaster Plugin ===
Oracle GeoRaster Plugin
+
 
</H2>
+
  
<P>
 
 
In Oracle databases, raster data can be stored in SDO_GEORASTER objects available with the  
 
In Oracle databases, raster data can be stored in SDO_GEORASTER objects available with the  
Oracle Spatial extension. In QGIS, the oracle_rasterOracle GeoRaster Plugin  
+
Oracle Spatial extension. In QGIS, the {{Template:ToolBtnTwo|oracle_raster|Oracle GeoRaster Plugin}}
 
is supported by GDAL, and depends on Oracle's Database product being installed and working  
 
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  
 
on your machine. While Oracle is proprietary software, they provide their software free for  
行11: 行9:
 
to GeoRaster:
 
to GeoRaster:
  
<P>
+
<pre>  
<PRE>  
+
 
$ gdal_translate -of georaster input_file.tif geor:scott/tiger@orcl
 
$ gdal_translate -of georaster input_file.tif geor:scott/tiger@orcl
</PRE>
+
</pre>
  
<P>
 
 
This will load the raster into the default GDAL_IMPORT table, as a column named RASTER.
 
This will load the raster into the default GDAL_IMPORT table, as a column named RASTER.
  
<P>
+
==== Managing connections ====
<BR><HR>
+
<!--Table of Child-Links-->
+
<STRONG>Subsections</STRONG>
+
  
<UL CLASS="ChildLinks">
 
<LI>[[Managing connections]]
 
<LI>[[Selecting a GeoRaster]]
 
<LI>[[Displaying GeoRaster]]
 
</UL>
 
<!--End of Table of Child-Links-->
 
<BR><HR>
 
 
<H3>
 
Managing connections
 
</H3>
 
 
<P>
 
 
Firstly, the Oracle GeoRaster Plugin must be enabled using the Plugin Manager (see Section  
 
Firstly, the Oracle GeoRaster Plugin must be enabled using the Plugin Manager (see Section  
[[#sec:load_core_plugin]]). The first time you load a GeoRaster in QGIS, you must create a  
+
[[sec:load_core_plugin]]). 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  
 
connection to the Oracle database that contains the data. To do this, begin by clicking on  
the oracle_rasterSelect GeoRaster toolbar button, it will open the Select Oracle  
+
the {{Template:ToolBtnTwo|oracle_raster|Select GeoRaster}} toolbar button, it will open the Select Oracle  
Spatial GeoRaster dialog window. Click on New to open the dialog window, and specify  
+
Spatial GeoRaster dialog window. Click on {{Template:Button|New}} to open the dialog window, and specify  
the connection parameters (See Figure [[#fig:oracle_create|62]]):
+
the connection parameters (See Figure [[fig:oracle_create]]):
  
<P>
+
<ul>
 +
<li>'''Name''': Enter a name for the database connection.
 +
<li>'''Database instance''': Enter the name of the database that you will connect to.
 +
<li>'''Username''': Specify your own username that you will use to access the database.
 +
<li>'''Password''': The password associated with your username that is required to access the database.
 +
</ul>
  
<UL>
+
<table align='center'>
<LI><SPAN  CLASS="textbf">Name</SPAN>: Enter a name for the database connection.
+
<caption>'''Figure xx:''' Create Oracle connection dialog {{Template:Nix</caption>
</LI>
+
<tr><td>}caption}<span id='fig:oracle_create'></span>
<LI><SPAN  CLASS="textbf">Database instance</SPAN>: Enter the name of the database that you will connect to.
+
  [[File:oracle_create_dialog.png|340px]]</td></tr></table>
</LI>
+
<LI><SPAN  CLASS="textbf">Username</SPAN>: Specify your own username that you will use to access the database.
+
</LI>
+
<LI><SPAN  CLASS="textbf">Password</SPAN>: The password associated with your username that is required to access the database.
+
</LI>
+
</UL>
+
  
<P>
+
Now, back on the main Oracle Spatial GeoRaster dialog window (See Figure [[fig:oracle_select]]), use the
 +
drop-down list to choose one connection, and use the {{Template:Button|Connect}} button to establish a connection. You
 +
may also {{Template:Button|Edit}} the connection by opening the previous dialog and making changes to the connection
 +
information, or use the {{Template:Button|Delete}} button to remove the connection from the drop-down list.
  
<DIV ALIGN="CENTER"><A NAME="fig:oracle_create"></A><A NAME="20"></A>
+
==== Selecting a GeoRaster ====
<TABLE>
+
<CAPTION ALIGN="BOTTOM"><STRONG>Figure:</STRONG>
+
Create Oracle connection dialog </CAPTION>
+
<TR><TD>
+
<DIV ALIGN="CENTER">
+
</DIV>
+
<P></P>
+
<DIV ALIGN="CENTER">  [clip=true, width=9cm]oracle_create_dialog
+
  
</DIV></TD></TR>
 
</TABLE>
 
</DIV>
 
 
<P>
 
Now, back on the main Oracle Spatial GeoRaster dialog window (See Figure [[node3.html#fig:oracle_select|63]]), use the
 
drop-down list to choose one connection, and use the Connect button to establish a connection. You
 
may also Edit the connection by opening the previous dialog and making changes to the connection
 
information, or use the Delete button to remove the connection from the drop-down list.
 
 
<P>
 
 
<H3>
 
Selecting a GeoRaster
 
</H3>
 
 
<P>
 
 
Once a connection has been established, the sub-datasets window will show the names of all the tables that  
 
Once a connection has been established, the sub-datasets window will show the names of all the tables that  
 
contains GeoRaster columns in that database in the format of a GDAL subdataset name.
 
contains GeoRaster columns in that database in the format of a GDAL subdataset name.
  
<P>
+
Click on one of the listed subdatasets and then click on {{Template:Button|Select}} to choose the table name. Now another  
Click on one of the listed subdatasets and then click on Select to choose the table name. Now another  
+
 
list of subdatasets will show with the names of GeoRaster columns on that table. This is usually a short list,  
 
list of subdatasets will show with the names of GeoRaster columns on that table. This is usually a short list,  
 
since most users will not have more than one or two GeoRaster columns on the same table.
 
since most users will not have more than one or two GeoRaster columns on the same table.
  
<P>
+
Click on one of the listed subdatasets and then click on {{Template:Button|Select}} to choose one of the the table/column  
Click on one of the listed subdatasets and then click on Select to choose one of the the table/column  
+
 
combination. The dialog will now show all the rows that contains GeoRaster objects. Note that the subdataset  
 
combination. The dialog will now show all the rows that contains GeoRaster objects. Note that the subdataset  
 
list will now show the Raster Data Table and Raster Id's pairs.
 
list will now show the Raster Data Table and Raster Id's pairs.
  
<P>
 
 
At anytime the Selection entry can be edited in order to go directly to a known GeoRaster or to go back to the  
 
At anytime 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.
 
beginning and select another table name.
  
<P>
+
<table align='center'>
 +
<caption>'''Figure xx:''' Select Oracle GeoRaster dialog {{Template:Nix</caption>
 +
<tr><td>}caption}<span id='fig:oracle_select'></span>
 +
  [[File:oracle_select_dialog.png|340px]]</td></tr></table>
  
<DIV ALIGN="CENTER"><A NAME="fig:oracle_select"></A><A NAME="34"></A>
 
<TABLE>
 
<CAPTION ALIGN="BOTTOM"><STRONG>Figure:</STRONG>
 
Select Oracle GeoRaster dialog </CAPTION>
 
<TR><TD>
 
<DIV ALIGN="CENTER">
 
</DIV>
 
<P></P>
 
<DIV ALIGN="CENTER">  [clip=true, width=9cm]oracle_select_dialog
 
 
</DIV></TD></TR>
 
</TABLE>
 
</DIV>
 
 
<P>
 
 
The Selection data entry can also be used to enter a Where clause at the end of the  identification string, e.g.,  
 
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=''.http://www.gdal.org/frmt_georaster.html< for more information.
+
``geor:scott/tiger@orcl,gdal_import,raster,geoid=''. See {{Template:URL|http://www.gdal.org/frmt_georaster.html}} for more information.
 
+
<P>
+
  
<H3>
+
==== Displaying GeoRaster ====
Displaying GeoRaster
+
</H3>
+
  
<P>
 
 
Finally, by selecting a GeoRaster from the list of Raster Data Table and Raster Id's, the raster image will be  
 
Finally, by selecting a GeoRaster from the list of Raster Data Table and Raster Id's, the raster image will be  
 
loaded into QGIS.
 
loaded into QGIS.
  
<P>
 
 
The Select Oracle Spatial GeoRaster dialog window can be closed now and next time it opens it will keep the same  
 
The Select Oracle Spatial GeoRaster dialog window can be closed now and next time it opens it will keep the same  
 
connection, and will show the same previous list of subdataset making it very easy to open up another image  
 
connection, and will show the same previous list of subdataset making it very easy to open up another image  
 
from the same context.
 
from the same context.
  
<P>
+
'''Note:''' GeoRasters that contains pyramids will display much faster but the pyramids need to be generated  
<SPAN  CLASS="textbf">Note:</SPAN> GeoRasters that contains pyramids will display much faster but the pyramids need to be generated  
+
 
outside of QGIS using Oracle PL/SQL or gdaladdo.
 
outside of QGIS using Oracle PL/SQL or gdaladdo.
  
<P>
 
 
The following is example using gdaladdo:
 
The following is example using gdaladdo:
  
<P>
+
<pre>
<PRE>
+
gdaladdo georaster:scott/tiger@orcl,georaster_table,georaster,georid=6 -r  
gdaladdo georaster:scott/tiger@orcl,georaster\_table,georaster,georid=6 -r  
+
 
nearest 2 4 6 8 16 32
 
nearest 2 4 6 8 16 32
</PRE>
+
</pre>
  
<P>
 
 
This is an example using PL/SQL:  
 
This is an example using PL/SQL:  
 
cd ..
 
cd ..
<PRE>
+
<pre>
 
$ sqlplus scott/tiger
 
$ sqlplus scott/tiger
SQL&gt; DECLARE
+
SQL> DECLARE
 
     gr sdo_georaster;
 
     gr sdo_georaster;
 
BEGIN
 
BEGIN
行165: 行97:
 
END;
 
END;
 
/
 
/
</PRE>
+
</pre>
 
+
<P>
+
<BR><HR>
+

2009年10月5日 (月) 23:14時点における版

Oracle 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.png Oracle 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

This will load the raster into the default GDAL_IMPORT table, as a column named RASTER.

Managing connections

Firstly, the Oracle GeoRaster Plugin must be enabled using the Plugin Manager (see Section sec:load_core_plugin). 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.png Select GeoRaster toolbar button, it will open the Select Oracle Spatial GeoRaster dialog window. Click on New to open the dialog window, and specify the connection parameters (See Figure fig:oracle_create):

  • 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: The password associated with your username that is required to access the database.
Figure xx: Create Oracle connection dialog {{Template:Nix
}caption} Oracle create dialog.png

Now, back on the main Oracle Spatial GeoRaster dialog window (See Figure fig:oracle_select), use the drop-down list to choose one connection, and use the Connect button to establish a connection. You may also Edit the connection by opening the previous dialog and making changes to the connection information, or use the Delete button to remove the connection from the drop-down list.

Selecting a GeoRaster

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

Click on one of the listed subdatasets and then click on Select to choose the table name. Now another list of subdatasets will show with the names of GeoRaster columns on that table. This is usually a short list, since most users will not have more than one or two GeoRaster columns on the same table.

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

At anytime 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 xx: Select Oracle GeoRaster dialog {{Template:Nix
}caption} Oracle select dialog.png

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.

Displaying GeoRaster

Finally, by selecting a GeoRaster from the list of Raster Data Table and Raster Id's, the raster image will be loaded into QGIS.

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

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

The following is example using gdaladdo:

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

This is an example using PL/SQL: cd ..

$ 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;
/