ilog.views.maps.format.oracle
Class IlvSDOWriter

java.lang.Object
  extended by ilog.views.maps.format.oracle.IlvSDOWriter

public class IlvSDOWriter
extends Object

This class can write the content of an IlvFeatureIterator to an Oracle SDO layer. The supported map feature geometries are all those supported by Oracle SDO Relational Model.

The following example shows how to use this class to create a SDO layer in an Oracle database, fill it with map features coming from an IlvFeatureIterator, and create a spatial index.

 IlvSDOWriter writer =  
new IlvSDOWriter(connection, "MyLayer", 16, new IlvCoordinate(-360d, 90d), new IlvCoordinate(360d, -90d)); // creating a source feature iterator IlvShapeFileReader reader = new IlvShapeFileReader(...); // dumping its content to the Oracle layer writer.writeFeatureIterator(reader); // Creating an SDO spatial index writer.populateIndexes(IlvSDOUtil.EstimateTilingLevel(connection, "MyLayer", IlvSDOUtil.LAYER_EXTENT, 360*180));

Since:
JViews 3.0

Constructor Summary
IlvSDOWriter(Connection connection, String layerName, int sdoGeomCoordinatesCount, IlvCoordinate upperLeftBound, IlvCoordinate lowerRightBound)
          Initializes an IlvSDOWriter that creates an SDO layer.
IlvSDOWriter(Connection connection, String layerName, int firstGidValue, String ownerName)
          Initializes an IlvSDOWriter to write data to an existing SDO layer.
 
Method Summary
 Connection getConnection()
          Returns the current connection of the writer.
 String getLayerName()
          Returns the current layer name of the writer.
 String getOwnerName()
          Returns the owner name of the SDO table.
 void populateIndexes(int tilingLevel)
          Creates and populates the spatial index table using a specified tiling level.
 void writeFeature(IlvMapFeature feature)
          Puts the map feature passed as argument in the [layerName]_SDOGEOM table.
 int writeFeatureIterator(IlvMapFeatureIterator reader)
          Writes the iterator passed as its argument into the Oracle SDO database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvSDOWriter

public IlvSDOWriter(Connection connection,
                    String layerName,
                    int firstGidValue,
                    String ownerName)
             throws SQLException
Initializes an IlvSDOWriter to write data to an existing SDO layer.

Parameters:
connection - The connection to the Oracle database
layerName - The name of the SDO layer to which the geometries will be appended
firstGidValue - The first value for the gid of the first geometry that will be saved in the database. The writer will then increment this value for the following gid values.
ownerName - The name of the owner of the SDO table
Throws:
SQLException

IlvSDOWriter

public IlvSDOWriter(Connection connection,
                    String layerName,
                    int sdoGeomCoordinatesCount,
                    IlvCoordinate upperLeftBound,
                    IlvCoordinate lowerRightBound)
             throws SQLException
Initializes an IlvSDOWriter that creates an SDO layer. The IlvSDOWriter object can then populate the layer with one or more IlvMapFeatureIteratorobjects.

Parameters:
connection - The connection to the Oracle database
layerName - The SDO layer name for the writer
sdoGeomCoordinatesCount - The number of coordinate columns in the [layerName]_SDOGEOM table. For example, setting this parameter to 8 will create the [layerName]_SDOGEOM table with the following columns: SDO_GID, SDO_ESEQ, SDO_ETYPE, SDO_SEQ, SDO_X1, SDO_Y1, ..., SDO_X8, SDO_Y8.
upperLeftBound - The upper-left corner of the bounding box of the SDO layer
lowerRightBound - The lower-right corner of the bounding box of the SDO layer
Throws:
SQLException
Method Detail

getOwnerName

public String getOwnerName()
Returns the owner name of the SDO table.


getLayerName

public String getLayerName()
Returns the current layer name of the writer.


getConnection

public Connection getConnection()
Returns the current connection of the writer.


writeFeature

public void writeFeature(IlvMapFeature feature)
                  throws Exception
Puts the map feature passed as argument in the [layerName]_SDOGEOM table.

Throws:
Exception

writeFeatureIterator

public int writeFeatureIterator(IlvMapFeatureIterator reader)
                         throws Exception
Writes the iterator passed as its argument into the Oracle SDO database. It returns the number of saved objects.

Parameters:
reader - The IlvMapFeatureIterator instance
Throws:
Exception

populateIndexes

public void populateIndexes(int tilingLevel)
                     throws SQLException
Creates and populates the spatial index table using a specified tiling level. Creating a spatial index is mandatory for the use of an IlvSDOLayer.

Parameters:
tilingLevel - The sdo layer's tiling level value.
Throws:
SQLException


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.