|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.data.oracle.sdo.SDO
Oracle Spatial Data Object utilities functions.
Provide utility functions for working with JTS Geometries in terms Oracle Spatial Data Objects
This class can be used for normal JTS Geometry persistence with little fuss and bother - please see GeometryConverter for an example of this.
With a little fuss and bother LRS information can also be handled. Although it is very rare that JTS makes use of such things.
net.refractions.jspatial.jts
Field Summary | |
static int |
SRID_NULL
|
Constructor Summary | |
SDO()
|
Method Summary | |
static com.vividsolutions.jts.geom.Coordinate[] |
asCoordiantes(double[] ordinates,
int d)
Coordiantes from a (x,y,i3.. |
static com.vividsolutions.jts.geom.Coordinate[] |
asCoordinates(double[] ordinates)
Coordiantes from (x,y,x2,y2,...) |
static com.vividsolutions.jts.geom.CoordinateSequence |
coordiantes(com.vividsolutions.jts.geom.CoordinateSequenceFactory f,
AttributeList x,
AttributeList y,
AttributeList z)
Construct CoordinateSequence with no LRS measures. |
static com.vividsolutions.jts.geom.CoordinateSequence |
coordiantes(com.vividsolutions.jts.geom.CoordinateSequenceFactory f,
AttributeList x,
AttributeList y,
AttributeList z,
AttributeList[] m)
Construct SpatialCoordiantes, with LRS measure information. |
static com.vividsolutions.jts.geom.CoordinateSequence |
coordiantes(com.vividsolutions.jts.geom.CoordinateSequenceFactory f,
OrdinateList x,
OrdinateList y,
OrdinateList z)
Construct CoordinateSequence with no LRS measures. |
static com.vividsolutions.jts.geom.CoordinateSequence |
coordiantes(com.vividsolutions.jts.geom.CoordinateSequenceFactory f,
OrdinateList x,
OrdinateList y,
OrdinateList z,
OrdinateList[] m)
Construct SpatialCoordiantes, with LRS measure information. |
static com.vividsolutions.jts.geom.CoordinateSequence |
coordinates(com.vividsolutions.jts.geom.CoordinateSequenceFactory f,
int GTYPE,
double[] ordinates)
Construct CoordinateList as described by GTYPE. |
static void |
coordinates(java.util.List list,
com.vividsolutions.jts.geom.Geometry geom)
Encode Geometry as described by GTYPE and ELEM_INFO CoordinateSequence & CoordinateAccess wil be used to determine the dimension, and the number of ordinates added. |
static com.vividsolutions.jts.geom.CoordinateSequence |
counterClockWise(com.vividsolutions.jts.geom.CoordinateSequenceFactory factory,
com.vividsolutions.jts.geom.CoordinateSequence ring)
Ensure Ring of Coordinates are in a counter clockwise order. |
static com.vividsolutions.jts.geom.Geometry |
create(com.vividsolutions.jts.geom.GeometryFactory gf,
int GTYPE,
int SRID,
double[] point,
int[] elemInfo,
double[] ordinates)
Decode geometry from provided SDO encoded information. |
static com.vividsolutions.jts.geom.Geometry |
create(com.vividsolutions.jts.geom.GeometryFactory gf,
int GTYPE,
int SRID,
int[] elemInfo,
int triplet,
com.vividsolutions.jts.geom.CoordinateSequence coords,
int N)
Consturct geometry with SDO encoded information over a CoordinateList. |
static int |
D(com.vividsolutions.jts.geom.Geometry geom)
Return D as defined by SDO_GTYPE (either 2,3 or 4). |
static int |
D(int GTYPE)
Access D (for dimension) as encoded in GTYPE |
static int[] |
elemInfo(com.vividsolutions.jts.geom.Geometry geom)
Return SDO_ELEM_INFO array for geometry Describes how to use Ordinates to represent Geometry. |
static int[] |
elemInfo(com.vividsolutions.jts.geom.Geometry geom,
int GTYPE)
|
protected static int |
elemInfoEType(com.vividsolutions.jts.geom.Geometry geom)
Produce SDO_ETYPE for geometry description as stored in the
SDO_ELEM_INFO .
|
static int |
elemInfoInterpretation(com.vividsolutions.jts.geom.Geometry geom)
Produce SDO_INTERPRETATION for geometry description as
stored in the SDO_ELEM_INFO .
|
static int |
elemInfoInterpretation(com.vividsolutions.jts.geom.Geometry geom,
int etype)
Allows specification of INTERPRETATION used to interpret
geom .
|
static int |
elemInfoStartingOffset(com.vividsolutions.jts.geom.Geometry geom)
Starting offset used by SDO_ORDINATES as stored in the SDO_ELEM_INFO array. |
static com.vividsolutions.jts.geom.CoordinateSequence |
getCS(com.vividsolutions.jts.geom.Geometry geom)
|
static int |
gType(com.vividsolutions.jts.geom.Geometry geom)
Produce SDO_GTYPE representing provided Geometry. |
static int |
L(com.vividsolutions.jts.geom.Geometry geom)
Return L as defined by SDO_GTYPE (either 3,4 or 0). |
static int |
L(int GTYPE)
Access L (for LRS) as encoded in GTYPE |
static double[] |
ordinateArray(com.vividsolutions.jts.geom.Coordinate[] array,
int ordinate)
Ordinate access. |
static double[] |
ordinateArray(com.vividsolutions.jts.geom.CoordinateSequence coords,
int ordinate)
Package up array of requested ordinate, regardless of geometry Example numbering: for (x y g m) dimension==2, measure==2 0: x ordinate array 1: y ordinate array 2: g ordinate array 3: m ordinate array |
static double[] |
ordinateArray(java.util.List list,
int ordinate)
|
static double[] |
ordinates(com.vividsolutions.jts.geom.Geometry geom)
Produce SDO_ORDINATES for geometry.
|
static double[] |
ordinates(java.util.List list,
com.vividsolutions.jts.geom.Geometry geom)
Package up array in correct manner for geom .
|
static double[] |
ordinates2d(java.util.List list)
Ordinates (x,y,x1,y1,...) from coordiante list. |
static double[] |
ordinates2d(java.util.List list,
int L)
Ordinates (x,y,...id,x2,y2,...) from coordiante[] List. |
static double[] |
ordinates3d(java.util.List list)
Ordinates (x,y,z,x2,y2,z2...) from coordiante[] array. |
static double[] |
ordinates3d(java.util.List list,
int L)
Ordinates (x,y,z,...id,x2,y2,z2...) from coordiante[] array. |
static double[] |
point(com.vividsolutions.jts.geom.Geometry geom)
Return SDO_POINT_TYPE for geometry Will return non null for Point objects. |
static int |
SRID(com.vividsolutions.jts.geom.Geometry geom)
Returns geometry SRID. |
static int |
TT(com.vividsolutions.jts.geom.Geometry geom)
Return TT as defined by SDO_GTYPE (represents geometry type). |
static int |
TT(int GTYPE)
Access TT (for geometry type) as encoded in GTYPE |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int SRID_NULL
Constructor Detail |
public SDO()
Method Detail |
public static int gType(com.vividsolutions.jts.geom.Geometry geom)
Encoding of Geometry type and dimension.
SDO_GTYPE defined as for digits [d][l][tt]
:
d
: number of dimensions (limited to 2,3, or 4)
l
: measure representation (ordinate 3 or 4) or 0 to
represent none/last
tt:
See the TT. constants defined in this class
Definition provided by Oracle Spatial User???s Guide and Reference.
geom
-
public static int D(com.vividsolutions.jts.geom.Geometry geom)
For normal JTS Geometry this will be 2 or 3 depending if geom.getCoordinate.z is Double.NaN.
Subclasses may override as required.
geom
-
3
public static int L(com.vividsolutions.jts.geom.Geometry geom)
L represents support for LRS (Liniar Referencing System?). JTS Geometry objects do not support LRS so this will be 0.
Subclasses may override as required.
geom
-
0
public static int TT(com.vividsolutions.jts.geom.Geometry geom)
TT is used to represent the type of the JTS Geometry:
Value Geometry Type JTS Geometry
00 UNKNOWN_GEOMETRY null
01 POINT Point
02 LINE LineString
CURVE not supported
03 POLYGON Polygon
04 COLLECTION GeometryCollection
05 MULTIPOINT MultiPoint
06 MULTILINE MultiLineString
MULTICURVE not supported
07 MULTIPOLYGON MultiPolygon
geom
-
TT
representing geom
java.lang.IllegalArgumentException
- If SDO_GTYPE can not be represetned by
JTSpublic static int SRID(com.vividsolutions.jts.geom.Geometry geom)
SRID code representing Spatial Reference System. SRID number used must be defined in the Oracle MDSYS.CS_SRS table.
SRID_NULL
represents lack of coordinate system.
geom
- Geometry SRID Number (JTS14 uses GeometryFactor.getSRID() )
SRID
for provided geompublic static double[] point(com.vividsolutions.jts.geom.Geometry geom)
Will return non null for Point objects. null
is returned
for all non point objects.
You cannot use this with LRS Coordiantes
Subclasses may wish to repress this method and force Points to be represented using SDO_ORDINATES.
geom
-
public static int[] elemInfo(com.vividsolutions.jts.geom.Geometry geom)
Describes how to use Ordinates to represent Geometry.
# Name Meaning
0 SDO_STARTING_OFFSET Offsets start at one
1 SDO_ETYPE Describes how ordinates are ordered
2 SDO_INTERPRETATION SDO_ETYPE: 4, 1005, or 2005
Number of triplets involved in compound geometry
SDO_ETYPE: 1, 2, 1003, or 2003
Describes ordering of ordinates in geometry
For compound elements (SDO_ETYPE values 4 and 5) the last element of one is the first element of the next.
geom
- Geometry being represented
public static int[] elemInfo(com.vividsolutions.jts.geom.Geometry geom, int GTYPE)
public static int elemInfoStartingOffset(com.vividsolutions.jts.geom.Geometry geom)
Starting offsets start from one.
Describes ordinates as part of SDO_ELEM_INFO
data type.
geom
-
1
for non nested geom
protected static int elemInfoEType(com.vividsolutions.jts.geom.Geometry geom)
SDO_ETYPE
for geometry description as stored in the
SDO_ELEM_INFO
.
Describes how Ordinates are ordered:
Value Elements Meaning
0 Custom Geometry (like spline)
1 simple Point (or Points)
2 simple Line (or Lines)
3 polygon ring of unknown order (discouraged update to 1003 or 2003)
1003 simple polygon ring (1 exterior counterclockwise order)
2003 simple polygon ring (2 interior clockwise order)
4 compound series defines a linestring
5 compound series defines a polygon ring of unknown order (discouraged)
1005 compound series defines exterior polygon ring (counterclockwise order)
2005 compound series defines interior polygon ring (clockwise order)
Keep in mind:
simple
elements are defined by a single triplet entry in
the SDO_ELEM_INFO
array
compound
elements are defined by a header triplet, and a
series of triplets for the parts. Elements in a compound element share
first and last points.
This whole mess describes ordinates as part of
SDO_ELEM_INFO
array. data type.
geom
- Geometry being represented
java.lang.IllegalArgumentException
public static int elemInfoInterpretation(com.vividsolutions.jts.geom.Geometry geom)
SDO_INTERPRETATION
for geometry description as
stored in the SDO_ELEM_INFO
.
Describes ordinates as part of SDO_ELEM_INFO
array.
compound
element:(SDO_ETYPE 4, 1005, or 2005)simple
element:(SDE_ELEM 1, 2, 1003, or 2003)SDO_INTERPRETAION Values: (from Table 2-2 in reference docs)
SDO_ETYPE Value Meaning
0 anything Custom Geometry
1 1 Point
1 N > 1 N points
2 1 LineString of straight lines
2 2 LineString connected by circ arcs (start,any,end pt)
1003/2003 1 Polygon Edged with straight lines
1003/2003 2 Polygon Edged with circ arcs (start, any, end pt)
1003/2003 3 Non SRID rectangle defined by (bottomleft,topright pt)
1003/2003 4 Circle defined by three points on circumference
4 N > 1 Compound Line String made of N (ETYPE=2) lines and arcs
1005/2005 N > 1 Polygon defined by (ETYPE=2) lines and arcs
When playing with circular arcs (SDO_INTERPRETATION==2) arcs are defined by three points. A start point, any point on the arc and the end point. The last point of an arc is the start point of the next. When used to describe a polygon (SDO_ETYPE==1003 or 2003) the first and last point must be the same.
geom
-
public static int elemInfoInterpretation(com.vividsolutions.jts.geom.Geometry geom, int etype)
INTERPRETATION
used to interpret
geom
.
Provides the INTERPRETATION value for the ELEM_INFO triplet of (STARTING_OFFSET, ETYPE, INTERPRETATION).
geom
- Geometry to encodeetype
- ETYPE value requiring an INTERPREATION
java.lang.IllegalArgumentException
- If asked to encode a curvepublic static double[] ordinates(com.vividsolutions.jts.geom.Geometry geom)
SDO_ORDINATES
for geometry.
Please see SDO_ETYPE, SDO_INTERPRETATION and SDO_GTYPE for description of how these ordinates are to be interpreted.
Ordinates are ordered by Dimension are non null:
Two Dimensional:
{x1,y1,x2,y2,...}Three Dimensional:
{x1,y1,z1,x2,y2,z2,...}Spatial will siliently detect and ignore the following:
While Oracle is silient on these errors - all other errors will not be detected!
geom
-
public static com.vividsolutions.jts.geom.CoordinateSequence getCS(com.vividsolutions.jts.geom.Geometry geom)
public static void coordinates(java.util.List list, com.vividsolutions.jts.geom.Geometry geom)
CoordinateSequence & CoordinateAccess wil be used to determine the dimension, and the number of ordinates added.
list
- Flat list of Doublegeom
- Geometry
java.lang.IllegalArgumentException
- If geometry cannot be encodedpublic static double[] ordinateArray(com.vividsolutions.jts.geom.CoordinateSequence coords, int ordinate)
Example numbering: for (x y g m) dimension==2, measure==2
coords
- ordinate
-
public static double[] ordinateArray(com.vividsolutions.jts.geom.Coordinate[] array, int ordinate)
CoordianteAccess is required for additional ordinates.
Ordinate limitied to:
array
- ordinate
-
public static double[] ordinateArray(java.util.List list, int ordinate)
public static double[] ordinates(java.util.List list, com.vividsolutions.jts.geom.Geometry geom)
array
in correct manner for geom
.
Ordinates are placed into an array based on:
list
- geom
-
public static double[] ordinates2d(java.util.List list)
No assumptions are made about the order
list
- coordinate list
public static double[] ordinates3d(java.util.List list)
list
- List of coordiante
public static double[] ordinates2d(java.util.List list, int L)
list
- coordiante listL
- Dimension of ordinates required for representation
public static double[] ordinates3d(java.util.List list, int L)
list
- coordinate array to be represented as ordinatesL
- Dimension of ordinates required for representation
public static com.vividsolutions.jts.geom.CoordinateSequence counterClockWise(com.vividsolutions.jts.geom.CoordinateSequenceFactory factory, com.vividsolutions.jts.geom.CoordinateSequence ring)
If the Coordiante need to be reversed a copy will be returned.
factory
- Factory to used to reverse CoordianteSequencering
- Ring of Coordinates
public static int D(int GTYPE)
GTYPE
- DOCUMENT ME!
public static int L(int GTYPE)
GTYPE
- DOCUMENT ME!
public static int TT(int GTYPE)
GTYPE
- DOCUMENT ME!
public static com.vividsolutions.jts.geom.Coordinate[] asCoordinates(double[] ordinates)
(x,y,x2,y2,...)
ordinates.
ordinates
- DOCUMENT ME!
public static com.vividsolutions.jts.geom.Coordinate[] asCoordiantes(double[] ordinates, int d)
(x,y,i3..,id,x2,y2...)
ordinates.
ordinates
- DOCUMENT ME!d
- DOCUMENT ME!
public static com.vividsolutions.jts.geom.CoordinateSequence coordinates(com.vividsolutions.jts.geom.CoordinateSequenceFactory f, int GTYPE, double[] ordinates)
GTYPE encodes the following information:
The number of ordinates per coordinate are taken to be L+D, and the number of ordinates should be a multiple of this value.
In the Special case of GTYPE 2001 and a three ordinates are interpreted as a single Coordinate rather than an error.
f
- CoordinateSequenceFactory used to encode ordiantes for JTSGTYPE
- Encoding of Dimension, LRS and TTypeordinates
-
java.lang.IllegalArgumentException
- DOCUMENT ME!public static com.vividsolutions.jts.geom.CoordinateSequence coordiantes(com.vividsolutions.jts.geom.CoordinateSequenceFactory f, OrdinateList x, OrdinateList y, OrdinateList z)
To produce two dimension Coordiantes pass in null
for z
f
- DOCUMENT ME!x
- DOCUMENT ME!y
- DOCUMENT ME!z
- DOCUMENT ME!
public static com.vividsolutions.jts.geom.CoordinateSequence coordiantes(com.vividsolutions.jts.geom.CoordinateSequenceFactory f, AttributeList x, AttributeList y, AttributeList z)
To produce two dimension Coordiantes pass in null
for z
f
- DOCUMENT ME!x
- DOCUMENT ME!y
- DOCUMENT ME!z
- DOCUMENT ME!
public static com.vividsolutions.jts.geom.CoordinateSequence coordiantes(com.vividsolutions.jts.geom.CoordinateSequenceFactory f, OrdinateList x, OrdinateList y, OrdinateList z, OrdinateList[] m)
To produce two dimension Coordiantes pass in null
for z
f
- DOCUMENT ME!x
- x-ordinatesy
- y-ordinatesz
- z-ordinates, null
for 2Dm
- column major measure information
public static com.vividsolutions.jts.geom.CoordinateSequence coordiantes(com.vividsolutions.jts.geom.CoordinateSequenceFactory f, AttributeList x, AttributeList y, AttributeList z, AttributeList[] m)
To produce two dimension Coordiantes pass in null
for z
f
- DOCUMENT ME!x
- x-ordinatesy
- y-ordinatesz
- z-ordinates, null
for 2Dm
- column major measure information
public static com.vividsolutions.jts.geom.Geometry create(com.vividsolutions.jts.geom.GeometryFactory gf, int GTYPE, int SRID, double[] point, int[] elemInfo, double[] ordinates)
gf
- Used to construct returned GeometryGTYPE
- SDO_GTYPE represents dimension, LRS, and geometry typeSRID
- SDO_SRID represents Spatial Reference Systempoint
- elemInfo
- ordinates
-
public static com.vividsolutions.jts.geom.Geometry create(com.vividsolutions.jts.geom.GeometryFactory gf, int GTYPE, int SRID, int[] elemInfo, int triplet, com.vividsolutions.jts.geom.CoordinateSequence coords, int N)
Helpful when dealing construction Geometries with your own Coordiante Types. The dimensionality specified in GTYPE will be used to interpret the offsets in elemInfo.
gf
- GTYPE
- Encoding of Dimension, LRS and TTypeSRID
- elemInfo
- triplet
- DOCUMENT ME!coords
- N
- Number of triplets (-1 for unknown/don't care)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |