| java.lang.Object org.geotools.data.oracle.sdo.GeometryConverter
GeometryConverter | public class GeometryConverter (Code) | | Sample use of SDO class for simple JTS Geometry.
If needed I can make a LRSGeometryConverter that allows
JTS Geometries with additional ordinates beyond xyz.
author: jgarnett |
Method Summary | |
protected double | asDouble(Datum datum, double DEFAULT) | protected double[] | asDoubleArray(STRUCT struct, double DEFAULT) | protected double[] | asDoubleArray(ARRAY array, double DEFAULT) | protected double[] | asDoubleArray(Datum data, double DEFAULT) | protected STRUCT | asEmptyDataType() Representation of null as an Empty SDO_GEOMETRY . | public Geometry | asGeometry(STRUCT sdoGeometry) Convert provided SDO_GEOMETRY to JTS Geometry. | protected int[] | asIntArray(ARRAY array, int DEFAULT) | protected int[] | asIntArray(Datum data, int DEFAULT) | protected int | asInteger(Datum datum, int DEFAULT) | public String | getDataTypeName() Used to handle MDSYS.SDO_GEOMETRY. | public boolean | isCapable(Geometry geom) Ensure that obj is a JTS Geometry (2D or 3D) with no LRS measures. | final protected ARRAY | toARRAY(double doubles, String dataType) Convience method for ARRAY construction. | final protected ARRAY | toARRAY(int ints, String dataType) Convience method for ARRAY construction. | final protected ARRAY | toATTRIBUTE(double ords, String desc) | final protected CHAR | toCHAR(String s) | final protected NUMBER | toNUMBER(double number) Convience method for NUMBER construction. | final protected NUMBER | toNUMBER(int number) | final protected ARRAY | toORDINATE(CoordinateList list, double measures, int D) Convience method for ARRAY construction. | final protected ARRAY | toORDINATE(double ords) | public STRUCT | toSDO(Geometry geom) Used to convert double[] to SDO_ODINATE_ARRAY. | final protected STRUCT | toSTRUCT(Datum attributes, String dataType) Convience method for STRUCT construction. |
connection | protected OracleConnection connection(Code) | | |
geometryFactory | GeometryFactory geometryFactory(Code) | | |
GeometryConverter | public GeometryConverter(OracleConnection connection)(Code) | | |
GeometryConverter | public GeometryConverter(OracleConnection connection, GeometryFactory geometryFactory)(Code) | | |
asDouble | protected double asDouble(Datum datum, double DEFAULT) throws SQLException(Code) | | Presents datum as a double
|
asDoubleArray | protected double[] asDoubleArray(STRUCT struct, double DEFAULT) throws SQLException(Code) | | Presents struct as a double[]
|
asDoubleArray | protected double[] asDoubleArray(ARRAY array, double DEFAULT) throws SQLException(Code) | | Presents array as a double[]
|
asDoubleArray | protected double[] asDoubleArray(Datum data, double DEFAULT) throws SQLException(Code) | | Presents Datum[] as a double[]
|
asEmptyDataType | protected STRUCT asEmptyDataType() throws SQLException(Code) | | Representation of null as an Empty SDO_GEOMETRY .
null as a SDO_GEOMETRY |
asGeometry | public Geometry asGeometry(STRUCT sdoGeometry) throws SQLException(Code) | | Convert provided SDO_GEOMETRY to JTS Geometry.
Will return null as null .
Parameters: sdoGeometry - datum STRUCT to be converted to a double[] JTS Geometry representing the provided datum throws: SQLException - See Also: net.refractions.jspatial.Converter.toObject(oracle.sql.STRUCT) |
asIntArray | protected int[] asIntArray(Datum data, int DEFAULT) throws SQLException(Code) | | Presents Datum[] as a int[]
|
asInteger | protected int asInteger(Datum datum, int DEFAULT) throws SQLException(Code) | | Presents datum as an int
|
getDataTypeName | public String getDataTypeName()(Code) | | Used to handle MDSYS.SDO_GEOMETRY.
MDSYS.SDO_GEOMETRY See Also: net.refractions.jspatial.Converter.getDataType |
isCapable | public boolean isCapable(Geometry geom)(Code) | | Ensure that obj is a JTS Geometry (2D or 3D) with no LRS measures.
This Converter does not support SpatialCoordinates
Parameters: geom - the Geometry to be converted true if obj is a JTS Geometry See Also: net.refractions.jspatial.Converter.isCapable(java.lang.Object) |
toARRAY | final protected ARRAY toARRAY(double doubles, String dataType) throws SQLException(Code) | | Convience method for ARRAY construction.
Compare and contrast with toORDINATE - which treats Double.NaN
asNULL
|
toARRAY | final protected ARRAY toARRAY(int ints, String dataType) throws SQLException(Code) | | Convience method for ARRAY construction.
|
toCHAR | final protected CHAR toCHAR(String s)(Code) | | Convience method for CHAR construction
|
toNUMBER | final protected NUMBER toNUMBER(double number) throws SQLException(Code) | | Convience method for NUMBER construction.
Double.NaN is represented as NULL to agree
with JTS use.
|
toNUMBER | final protected NUMBER toNUMBER(int number)(Code) | | Convience method for NUMBER construction
|
toORDINATE | final protected ARRAY toORDINATE(CoordinateList list, double measures, int D) throws SQLException(Code) | | Convience method for ARRAY construction.
Forced to burn memory here - only way to actually place
NULL numbers in the ordinate stream.
- JTS: records lack of data as
Double.NaN
- SDO: records lack of data as
NULL
The alternative is to construct the array from a array of
doubles, which does not record NULL NUMBERs.
The results is an "MDSYS.SDO_ORDINATE_ARRAY"
list = c1(1,2,0), c2(3,4,Double.NaN)
measures = {{5,6},{7,8}
toORDINATE( list, measures, 2 )
= (1,2,5,7, 3,4,6,8)
toORDINATE( list, measures, 3 )
= (1,2,0,5,7, 3,4,NULL,6,8)
toORDINATE( list, null, 2 )
= (1,2, 3,4)
Parameters: list - CoordinateList to be represented Parameters: measures - Per Coordiante Measures, null if not required Parameters: D - Dimension of Coordinates (limited to 2d, 3d) |
toSDO | public STRUCT toSDO(Geometry geom) throws SQLException(Code) | | Used to convert double[] to SDO_ODINATE_ARRAY.
Will return null as an empty SDO_GEOMETRY
Parameters: geom - Map to be represented as a STRUCT STRUCT representing provided Map See Also: net.refractions.jspatial.Converter.toDataType(java.lang.Object) |
toSTRUCT | final protected STRUCT toSTRUCT(Datum attributes, String dataType) throws SQLException(Code) | | Convience method for STRUCT construction.
|
|
|