public class OraReader extends Object
Geometry from an Oracle MDSYS.GEOMETRY STRUCT object.
The following Oracle geometry types are supported:
SDO_POINT
and RECTANGLE are supported in the following way:
SDO_POINT attribute is present
and SDO_ELEM_INFO and SDO_ORDINATES are not,
a Point geometry is read.
Otherwise, the geometry specified by the latter two attributes is read.
RECTANGLEs are converted to equivalent Polygons
A GeometryFactory may be provided, otherwise a default one will be used.
If a PrecisionModel other than PrecisionModel.FLOATING
is supplied it is the client's responsibility
to ensure that it matches the precision of the incoming data.
If a lower precision for the data is required, a subsequent
process must be run on the data to reduce its precision.
The coordinate dimension of the output is determined as follows:
setDimension(int) method
CoordinateSequenceFactory.
To use this class a suitable Oracle JDBC JAR must be present in the classpath.
43xx (XYMZ) are not supported.
| Constructor and Description |
|---|
OraReader()
Creates a new reader, with a default
GeometryFactory. |
OraReader(GeometryFactory gf)
Creates a new reader, with the supplied
GeometryFactory. |
| Modifier and Type | Method and Description |
|---|---|
int |
getDimension()
Gets the coordinate dimension which will be created.
|
Geometry |
read(oracle.sql.STRUCT struct)
Reads a
Geometry representing the MDSYS.GEOMETRY
provided in the STRUCT. |
void |
setDimension(int outputDimension)
Sets the coordinate dimension to use for created geometries.
|
public OraReader()
GeometryFactory.OraReader(GeometryFactory)public OraReader(GeometryFactory gf)
GeometryFactory.
It is assumed that the supplied PrecisionModel
matches the precision of the incoming data -
coordinates are not made precise when read.gf - A non-null geometry factory for later use.NullPointerException - when the geometry factory is null.public int getDimension()
public void setDimension(int outputDimension)
outputDimension - the coordinate dimension to createpublic Geometry read(oracle.sql.STRUCT struct) throws SQLException
Geometry representing the MDSYS.GEOMETRY
provided in the STRUCT. The type of geometry created
depends on the Geometry type specified within the STRUCT.
The SRID of the created geometry is set to be the same as the input SRID.struct - The MDSYS.GEOMETRY Object to decodeSQLException - if a read error occurs while accessing the structIllegalArgumentException - if an unsupported geometry type or encoding error is foundCopyright © 2015. All rights reserved.