public class IlvSDOWriter extends Object
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));
Constructor and Description |
---|
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. |
Modifier and Type | Method and Description |
---|---|
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.
|
public IlvSDOWriter(Connection connection, String layerName, int firstGidValue, String ownerName) throws SQLException
IlvSDOWriter
to write data to an existing
SDO layer.connection
- The connection to the Oracle databaselayerName
- The name of the SDO layer to which the geometries
will be appendedfirstGidValue
- 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 tableSQLException
public IlvSDOWriter(Connection connection, String layerName, int sdoGeomCoordinatesCount, IlvCoordinate upperLeftBound, IlvCoordinate lowerRightBound) throws SQLException
IlvSDOWriter
that creates an SDO layer. The IlvSDOWriter
object can then populate the layer with one or more IlvMapFeatureIterator
objects.connection
- The connection to the Oracle databaselayerName
- The SDO layer name for the writersdoGeomCoordinatesCount
- 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 layerlowerRightBound
- The lower-right corner of the bounding box of the SDO layerSQLException
public String getOwnerName()
public String getLayerName()
public Connection getConnection()
public void writeFeature(IlvMapFeature feature) throws Exception
Exception
public int writeFeatureIterator(IlvMapFeatureIterator reader) throws Exception
reader
- The IlvMapFeatureIterator
instanceException
public void populateIndexes(int tilingLevel) throws SQLException
IlvSDOLayer
.tilingLevel
- The sdo layer's tiling level value.SQLException
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.