public class IlvDefaultObjectSDOTileLoader extends IlvSDOTileLoader
IlvTileLoader
to load tiles
from Oracle Spatial, using the Oracle Spatial Object Relational Model.
The default tile loader loads 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 retrieve data, the tile loader 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
),
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
) and possibly, the extent of the layer.
The other
parameters such as tile width and tile height define one tile in the tiling
grid of the tile loader. And finally, when a key column name is specified
and extracted feature IDs are not null
, IlvMapFeature
belonging to multiple tiles are loaded just once.
IlvObjectSDOLayer
,
IlvSDOTileLoader
Constructor and Description |
---|
IlvDefaultObjectSDOTileLoader(IlvInputStream stream)
Reads the tile loader from an
IlvInputStream . |
IlvDefaultObjectSDOTileLoader(IlvSDOConnection connection,
IlvObjectSDOLayerMetaData metadata,
double tileWidth,
double tileHeight,
String xDimensionName,
String yDimensionName,
IlvObjectSDOKeyExtractor keyExtractor,
IlvRect size)
The main constructor of
IlvDefaultObjectSDOTileLoader . |
IlvDefaultObjectSDOTileLoader(IlvSDOConnection connection,
String layerName,
double tileWidth,
double tileHeight,
String keyColumnName)
Initializes an instance of
IlvDefaultObjectSDOTileLoader . |
Modifier and Type | Method and Description |
---|---|
void |
connectionRestored()
This method is called by the
IlvSDOLayer when
it is read from an .ivl file, and after the connection to an
Oracle Spatial database has been restored. |
IlvCoordinateSystem |
getDefaultCoordinateSystem()
Returns the default
IlvCoordinateSystem used to render map features when they do not have a specified one. |
IlvObjectSDOFeatureIterator |
getFeatureIterator(ResultSet resultSet,
String geometryName,
IlvObjectSDOKeyExtractor keyExtractor,
String xDimensionName,
String yDimensionName)
Returns the instance of
IlvObjectSDOFeatureIterator that is
used by the tile loader. |
int |
getFetchSize()
Returns the fetch size parameter passed to the
setRequestParameters method. |
IlvObjectSDOLayerMetaData |
getLayerMetaData()
Returns the metadata associated to this tile loader.
|
String |
getLayerName()
Returns the name of the SDO layer read by this tile loader.
|
String[] |
getRequestParameters()
Returns the parameters of the internal request used for load-on-demand.
|
ResultSet |
getResultSet(IlvTile tile)
Returns the
ResultSet containing the geometries that
intersect the specified tile. |
IlvRect |
getSize()
Returns size of the tile loader.
|
short |
getTileGroupingCount()
Returns the number of tiles to be loaded in one single Oracle request.
|
IlvRect |
getTileOrigin()
Returns the coordinates of the origin tile used by the load-on
demand mechanism.
|
boolean |
isClippingRequest()
Returns whether the tile loader will perform a strict clipping.
|
void |
load(IlvTile tile)
Loads a tile from the Oracle database and adds the graphic objects
to the layer of the tile.
|
void |
setClippingRequest(boolean set)
Sets whether this tile loader performs a strict clipping.
|
void |
setDefaultCoordinateSystem(IlvCoordinateSystem defaultCoordinateSystem)
Sets the default
IlvCoordinateSystem used to render map features when they do not have a specified one. |
void |
setRequestParameters(String selectClause,
String fromClause,
String whereClause,
String spatialOperator,
String spatialOperatorParams,
int fetchSize)
Sets some parameters in order to tune the request that is used by an
IlvTile . |
void |
setTileGroupingCount(short nb)
Sets the number of tiles to be loaded in one single Oracle request.
|
void |
write(IlvOutputStream stream)
Writes this tile loader to specified stream.
|
executeQuery, getConnection, isPersistent, release
public IlvDefaultObjectSDOTileLoader(IlvSDOConnection connection, String layerName, double tileWidth, double tileHeight, String keyColumnName) throws SQLException
IlvDefaultObjectSDOTileLoader
.
The geometries are read from the layer specified by its name. The name
of the coordinates of geometries are defaulted to "X" and "Y".
The geometry is read from the first column of the database for which
the type of data is specified to be SDO_GEOMETRY
.
connection
- The connection.layerName
- The name of the layer.tileWidth
- The width of one tile, in database units.tileHeight
- The height of one tile, in database units.keyColumnName
- The name of the column containing object ID or
null
if no ID is associated to features.SQLException
public IlvDefaultObjectSDOTileLoader(IlvSDOConnection connection, IlvObjectSDOLayerMetaData metadata, double tileWidth, double tileHeight, String xDimensionName, String yDimensionName, IlvObjectSDOKeyExtractor keyExtractor, IlvRect size) throws SQLException
IlvDefaultObjectSDOTileLoader
.
The geometries are read from the layer specified by its name. Geometries
are extracted from the column whose name is specified.
Feature IDs are extracted using the specified
IlvObjectSDOKeyExtractor
.
The extent of the whole layer (that is, the rectangle containing all
geometries of the layer) is generally kept up-to-date (by the user) in the
geometry metadata table of the Oracle Spatial Database.
However, in some cases, providing a more accurate extent (like the extent
returned using SDO_TUNE.EXTENT_OF
) can lead to much better
performances.
connection
- The IlvSDOConnection
to an Oracle Data Base with
the Spatial extensions.metadata
- The metadata of the layer to be loaded on demand.tileWidth
- The width of one tile, in database units.tileHeight
- The height of one tile, in database units.xDimensionName
- The name of the x-dimension.yDimensionName
- The name of the y-dimension.keyExtractor
- The key extractor to extract feature IDs.size
- The size of the layer. If set to null
,
the size is defaulted to the one available in the
geometry metadata table.SQLException
IlvObjectSDOUtil.GetLayerExtent(java.sql.Connection, java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean)
,
IlvObjectSDOLayerMetaData
,
IlvDefaultObjectSDOKeyExtractor
public IlvDefaultObjectSDOTileLoader(IlvInputStream stream) throws IlvReadFileException
IlvInputStream
.stream
- The input stream.IlvReadFileException
- if an error occurs while reading.public void setClippingRequest(boolean set)
IlvTile
that has loaded them.
The default behavior of this tile loader is to not perform this strict
clipping.set
- If true
, the strict clipping mode is set.isClippingRequest()
public boolean isClippingRequest()
IlvTile
that has loaded them.
The default behavior of this tile loader is to not perform this strict
clipping.true
if this tile loader clips strictly the
geometries.setClippingRequest(boolean)
public String getLayerName()
public IlvObjectSDOLayerMetaData getLayerMetaData()
public void connectionRestored() throws SQLException
IlvSDOLayer
when
it is read from an .ivl
file, and after the connection to an
Oracle Spatial database has been restored.
When the connection to the database has been restored, this method
collects the information that will allow the load-on-demand to work.connectionRestored
in class IlvSDOTileLoader
SQLException
public IlvRect getTileOrigin() throws SQLException
getTileOrigin
in class IlvSDOTileLoader
SQLException
public void setTileGroupingCount(short nb) throws SQLException
nb
- The number of tiles to be grouped in a single Oracle request.SQLException
getTileGroupingCount()
public short getTileGroupingCount()
setTileGroupingCount(short)
public void setRequestParameters(String selectClause, String fromClause, String whereClause, String spatialOperator, String spatialOperatorParams, int fetchSize) throws SQLException
IlvTile
.
The used request is of type: "select selectClause
from
fromClause
where whereClause
and
mdsys.spatialOperator
(layerName.geometryColumnName,
... ), 'spatialOperatorParams') = 'TRUE'" setRequestParameters("GEOMETRY", null, null, null, null);
null
.selectClause
- The select
clause of the request.
The default value is "*".fromClause
- The from
clause of the request.
The default value is the name of the SDO layer.whereClause
- The where
clause of the request.
The default value is null
.spatialOperator
- The spatial operator used in the request.
The default value is "sdo_filter". For more information about
spatial operators, please refer to the user's manual.spatialOperatorParams
- The parameters of the spatial operator.
The default value is "querytype=window".fetchSize
- The Oracle fetch size of all the statements used in this object. If you pass 0,
the parameter is ignored. The value recommended by Oracle is 10. See
Statement.setFetchSize
.SQLException
public String[] getRequestParameters()
setRequestParameters
method.setRequestParameters(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, int)
public final int getFetchSize()
setRequestParameters
method.
The default value is 10.setRequestParameters(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, int)
public ResultSet getResultSet(IlvTile tile) throws SQLException
ResultSet
containing the geometries that
intersect the specified tile. This method is called by
load(IlvTile tile)
when a tile needs to be loaded.
getResultSet
in class IlvSDOTileLoader
tile
- The tile to be filled with the SDO geometries.SQLException
load(ilog.views.tiling.IlvTile)
public IlvRect getSize() throws SQLException
getSize
in class IlvSDOTileLoader
SQLException
IlvTiledLayer.getSize()
public IlvObjectSDOFeatureIterator getFeatureIterator(ResultSet resultSet, String geometryName, IlvObjectSDOKeyExtractor keyExtractor, String xDimensionName, String yDimensionName) throws SQLException
IlvObjectSDOFeatureIterator
that is
used by the tile loader.
resultSet
- The resultSet
from which geometries are
read.geometryName
- The name of the column containing geometries.keyExtractor
- The extractor that can extract feature IDs from
the request rows.xDimensionName
- The name of the X dimension.yDimensionName
- The name of the Y dimension.IlvObjectSDOFeatureIterator
used internally
by the tile loader.SQLException
public void load(IlvTile tile) throws Exception
getResultSet
to get the SDO geometries, transforms them into graphic objects
using the renderer of the layer, and then adds the objects to the layer.load
in interface IlvTileLoader
load
in class IlvSDOTileLoader
tile
- The tile to load.Exception
- if an error occurs while loading the tile.getResultSet(ilog.views.tiling.IlvTile)
public void write(IlvOutputStream stream) throws IOException
write
in interface IlvPersistentObject
write
in interface IlvTileLoader
write
in class IlvSDOTileLoader
stream
- The output streamIOException
- if a write exception occurs.public IlvCoordinateSystem getDefaultCoordinateSystem()
IlvCoordinateSystem
used to render map features when they do not have a specified one.
Null by defaultpublic void setDefaultCoordinateSystem(IlvCoordinateSystem defaultCoordinateSystem)
IlvCoordinateSystem
used to render map features when they do not have a specified one.
Null by defaultdefaultCoordinateSystem
- The defaultCoordinateSystem to set.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.