public class IlvObjectSDOFeatureIterator extends Object implements IlvLookAheadFeatureIterator
IlvMapFeature
objects.
It supports the object relational implementation of Oracle Spatial. The geometry metadata table that is used through this class is SDO_GEOM_METADATA for Oracle 8.1.5- and USER_SDO_GEOM_METADATA for Oracle 8.1.6+.
This feature iterator allows to retrieve data from an Oracle Spatial layer.
This layer is a regular Oracle table which contains at least a geometry column
of type MDSYS.SDO_GEOMETRY. To read data, the feature iterator needs to know some
parameters available in the geometry metadata table such as the X dimension
name (if set to null
, the index of the X dimension in the
metadata table (in the SDO_DIM_ARRAY) will be considered as 0
)
and the Y dimension name (if set to null
, the index of the Y
dimension in the metadata table (in the SDO_DIM_ARRAY) will be considered as
1
).
When the key column name parameter is specified , IDs are associated to the
extracted IlvMapFeature
s and can be retrieved through the
IlvMapFeature.getId()
method.
In order to retrieve data from a Spatial layer, you have to provide a ResultSet
which comes from a Spatial query. The simplest query is the one allowing to
retrieve all the geometries of a layer: "select * from layerName"
.
IlvObjectSDOWriter
Modifier and Type | Class and Description |
---|---|
static class |
IlvObjectSDOFeatureIterator.IlvMapSDOImageBlock
Class defining an SDO image block geometry
|
static class |
IlvObjectSDOFeatureIterator.SDORasterMetaData
Class that holds information about Oracle SDO_RASTER objects
|
Constructor and Description |
---|
IlvObjectSDOFeatureIterator(Connection connection,
String request,
String geometryColumnName,
String keyColumnName,
String xDimensionName,
String yDimensionName)
Initializes a new instance of
IlvObjectSDOFeatureIterator . |
IlvObjectSDOFeatureIterator(ResultSet resultSet,
String geometryColumnName,
IlvObjectSDOKeyExtractor keyExtractor,
String xDimensionName,
String yDimensionName)
Initializes a new feature iterator to read geometries from specified
ResultSet . |
IlvObjectSDOFeatureIterator(ResultSet resultSet,
String geometryColumnName,
String keyColumnName)
Initializes a new
IlvObjectSDOFeatureIterator to read
geometries from specified ResultSet . |
IlvObjectSDOFeatureIterator(ResultSet resultSet,
String geometryColumnName,
String keyColumnName,
String xDimensionName,
String yDimensionName)
Initializes a new feature iterator to read geometries from specified
ResultSet . |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Releases the resources allocated by the feature iterator.
|
void |
finalize()
Finalizes this object.
|
IlvCoordinateSystem |
getCoordinateSystem()
Returns the spatial reference system that describes the coordinate
system of geometric coordinates of the iterator.
|
Long |
getCurrentSRID()
Returns the Oracle SRID of the last geometry read by the iterator.
|
IlvFeatureRenderer |
getDefaultFeatureRenderer()
Returns an instance of the default feature renderer.
|
IlvCoordinate |
getLowerRightCorner()
Returns the upper left corner of the rectangle containing all the map
features from this feature iterator.
|
IlvMapFeature |
getNextFeature()
Returns the next map feature of this feature iterator, or
null if the iteration if finished. |
Object |
getNextFeatureId()
Returns the feature ID for the next feature that will be
returned by this feature iterator.
|
IlvCoordinate |
getUpperLeftCorner()
Returns the upper left corner of the rectangle containing all the map
features from this feature iterator.
|
boolean |
isGeoreferenced()
Returns
true if a coordinate system has been assigned to the iterator. |
boolean |
isLoadingAttributes()
Returns
true if this feature iterator is loading attributes. |
protected IlvFeatureAttributeProperty |
makeAttributes(ResultSet resultSet)
This method reads attributes from the specified
ResultSet . |
protected IlvMapGeometry |
makeGeometry(Struct geom)
This method creates a geometry from the specified Object, which is
a
Struct representing a MDSYS.SDO_GEOMETRY . |
void |
setCoordinateSystem(IlvCoordinateSystem cs)
Used to specify the source coordinate system of the geometries stored in the SDO database.
|
void |
setLoadingAttributes(boolean loadAttributes)
If
loadAttributes is true , this feature iterator
will attach attributes to the features read. |
boolean |
skipNextFeature()
Skips the next feature.
|
public IlvObjectSDOFeatureIterator(Connection connection, String request, String geometryColumnName, String keyColumnName, String xDimensionName, String yDimensionName) throws SQLException
IlvObjectSDOFeatureIterator
.
ResultSet
resulting from
the specified request. Geometries are extracted from the column
which name is specified. Feature IDs are extracted from the column
name which name is specified.connection
- The connection.request
- The request from which geometries are read from.
It must have queried the geometry column of the SDO layer.geometryColumnName
- The name of the column containing geometries.keyColumnName
- The name of the column containing an ID considered
as a Key for each geometry. If set to null
, no
ID is associated to this feature.xDimensionName
- The name of the X dimension.yDimensionName
- The name of the Y dimension.SQLException
public IlvObjectSDOFeatureIterator(ResultSet resultSet, String geometryColumnName, String keyColumnName) throws SQLException
IlvObjectSDOFeatureIterator
to read
geometries from specified ResultSet
.
resultSet
- The ResultSet
from which geometries are
read from. This ResultSet
must contain
the column containing the geometries.geometryColumnName
- The name of the column containing geometries.keyColumnName
- The name of the column containing object ID or
null
if no ID is associated to features.SQLException
public IlvObjectSDOFeatureIterator(ResultSet resultSet, String geometryColumnName, String keyColumnName, String xDimensionName, String yDimensionName) throws SQLException
ResultSet
.
resultSet
- The ResultSet
from which geometries are
read from. This ResultSet
must contain
the column containing the geometries.geometryColumnName
- The name of the column containing geometries.keyColumnName
- The name of the column containing object ID or
null
if no ID is associated to features.xDimensionName
- The name of the X dimension.yDimensionName
- The name of the Y dimension.SQLException
public IlvObjectSDOFeatureIterator(ResultSet resultSet, String geometryColumnName, IlvObjectSDOKeyExtractor keyExtractor, String xDimensionName, String yDimensionName) throws SQLException
ResultSet
.
IlvObjectSDOKeyExtractor
.resultSet
- The ResultSet
from which geometries are
read from. This ResultSet
must contain
the column containing the geometries.geometryColumnName
- The name of the column containing geometries.keyExtractor
- Key extractor to extract feature IDs.xDimensionName
- The name of the X dimension.yDimensionName
- The name of the Y dimension.SQLException
public IlvCoordinateSystem getCoordinateSystem()
getCoordinateSystem
in interface IlvMapFeatureIterator
null
if the coordinate system is unknown.public boolean isGeoreferenced()
true
if a coordinate system has been assigned to the iterator.isGeoreferenced
in interface IlvMapFeatureIterator
setCoordinateSystem(ilog.views.maps.srs.coordsys.IlvCoordinateSystem)
public IlvFeatureRenderer getDefaultFeatureRenderer()
getDefaultFeatureRenderer
in interface IlvMapFeatureIterator
public void setCoordinateSystem(IlvCoordinateSystem cs)
IlvMapFeature
s produced by
this iterator even if the corresponding SDO geometry read from Oracle has an SRID.cs
- The coordinate system of the iterator.public IlvCoordinate getUpperLeftCorner()
ResultSet
, the upper left corner of this data source
is unknown.getUpperLeftCorner
in interface IlvMapFeatureIterator
null
public IlvCoordinate getLowerRightCorner()
ResultSet
, the upper left corner of this data source
is unknown.getLowerRightCorner
in interface IlvMapFeatureIterator
null
public boolean isLoadingAttributes()
true
if this feature iterator is loading attributes.public void setLoadingAttributes(boolean loadAttributes)
loadAttributes
is true
, this feature iterator
will attach attributes to the features read.public void dispose()
dispose
in interface IlvMapFeatureIterator
public Object getNextFeatureId() throws IlvSDOException
getNextFeatureId
in interface IlvLookAheadFeatureIterator
null
if no more
feature ID is available.IlvSDOException
public Long getCurrentSRID()
null
if no SRID is associated to the geometry or if the user has set
his own coordinate system in the iterator.public boolean skipNextFeature() throws IlvSDOException
skipNextFeature
in interface IlvLookAheadFeatureIterator
true
if more features are available.IlvSDOException
public IlvMapFeature getNextFeature() throws IOException
null
if the iteration if finished. The returned map
feature must be considered as volatile and can be modified by the
reader during the next call to this method.getNextFeature
in interface IlvMapFeatureIterator
IOException
protected IlvMapGeometry makeGeometry(Struct geom) throws SQLException, IlvMapFormatException
Struct
representing a MDSYS.SDO_GEOMETRY
.
geom
- The JDBC2.0 Struct
representing a MDSYS.SDO_GEOMETRY
.Struct
.SQLException
IlvMapFormatException
protected IlvFeatureAttributeProperty makeAttributes(ResultSet resultSet) throws IlvSDOException
ResultSet
.
The default implementation of this method is to attach all
columns of current row of the ResultSet
to an
IlvFeatureAttributeProperty
.
The name of the resulting attributes is the same as the database
column name of these attributes.
Only column of known type are processed.
Types from java.sql.Types
are mapped the following way:
IlvIntegerAttribute
.
IlvDoubleAttribute
IlvDoubleAttribute
IlvStringAttribute
IlvBooleanAttribute
resultSet
- The ResultSet
that contains also the geometry.IlvSDOException
IlvBooleanAttribute
,
IlvDoubleAttribute
,
IlvIntegerAttribute
,
IlvStringAttribute
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.