| java.lang.Object org.geotools.data.oracle.sdo.GeometryFixture
GeometryFixture | public class GeometryFixture (Code) | | Construct geometry used by test cases.
Several examples are from the the Oracle Spatial Geometry Spec.
See Also: net.refractions.jspatial.jts author: jgarnett, Refractions Reasearch Inc. version: CVS Version |
Constructor Summary | |
public | GeometryFixture() Construct Fixture for use with default GeometryFactory. | public | GeometryFixture(GeometryFactory geometryFactory) Construct Fixture for use with provided GeometryFactory . |
Method Summary | |
protected CoordinateSequence | coords(double coords) | protected GeometryCollection | createGeometryCollection() General Geometry Collection - with point, line, polygon, and a polygonWithHole. | protected LineString | createLineString() LineString geometry for testing fixture. | protected MultiLineString | createMultiLineString() MultiLineString geometry for testing fixture. | protected MultiPoint | createMultiPoint() MultiPoint geometry for testing fixture. | protected MultiPolygon | createMultiPolygon() Construct a multipolyugon with a square and a triangle. | protected MultiPolygon | createMultiPolygonWithHole() Construct a multipolyugon with a square with a hole and a triangle. | protected Point | createPoint() Geometry Example "2.3.5 Point". | protected Polygon | createPolygon() Construct a polygon of a triangle. | protected Polygon | createPolygonWithHole() Construct a polygon with hole according to Geometry Examples 2.3.2. | protected Polygon | createRectangle() Construct a rectangle according to Geometry Examples "2.3.1 Rectangle". | protected LinearRing | ring(double coords) |
geometryCollection | public GeometryCollection geometryCollection(Code) | | GeometryCollection used for testing
|
lineString | public LineString lineString(Code) | | LineString used for testing
|
multiLineString | public MultiLineString multiLineString(Code) | | MultiLineString used for testing
|
multiPoint | public MultiPoint multiPoint(Code) | | MultiPoint used for testing
|
multiPolygon | public MultiPolygon multiPolygon(Code) | | MultiPolygon used for testing
|
multiPolygonWithHole | public MultiPolygon multiPolygonWithHole(Code) | | MultiPolygon used for testing
|
point | public Point point(Code) | | Geometry Example "2.3.5 Point".
Simple Point used to test POINT_TYPE array use.
+ 12,14
|
polygon | public Polygon polygon(Code) | | Polygon used for testing
|
polygonWithHole | public Polygon polygonWithHole(Code) | | Geometry Example "2.3.2 Polygon with Hole".
A Polygon with a Hole as follows:
5,13+-------------+ 11,13
/ \
2,11+ \
| 7,10+----+10,10 \
| | | +13,9
| | | |
| | | |
| 7,5+----+10,5 +13,5
2,4+ /
\ /
4,3+---------------+10,3
|
rectangle | public Polygon rectangle(Code) | | Geometry Example "2.3.1 Rectangle".
A simple rectangle as used with CAD applications
(1,7) (5,7)
+-------------+
| |
| |
+-------------+
(1,1) (5,1)
|
GeometryFixture | public GeometryFixture()(Code) | | Construct Fixture for use with default GeometryFactory.
|
GeometryFixture | public GeometryFixture(GeometryFactory geometryFactory)(Code) | | Construct Fixture for use with provided GeometryFactory .
|
coords | protected CoordinateSequence coords(double coords)(Code) | | |
createGeometryCollection | protected GeometryCollection createGeometryCollection()(Code) | | General Geometry Collection - with point, line, polygon, and a polygonWithHole.
5,5+-------+9,5
| +6,4/
| /| /
|/ | /
2,3 +---+3,3 5,3+--+/6,3
|2,2| | /
1,2+ +---+3,2 | /
\ |/
1,1+ +2,1 5,1+
A GeometryCollection with expected encoding:
- SDO_GTYPE:
2004
2000 dimensional polygon, 000 for no LRS, 4 for geometry collection
- SDO_SRID:
0
- SDO_POINT:NULL>
- SDO_ELEM_INFO:
(1,1,1, 3,2,1, 7,1003,1, 15,1003,1, 23,2003,1)
Two triplets
- (1,1,1): starting at 1, a point(1) (single(1))
- (3,2,1): starting at 3, a line(2) with straight segments(1)
- (7,1003,1): starting at 5, an exterior(1000), polygon(3)
- (15,1003,1, 23,2003,1) polygon with:
- starting at 15 and exterior(1003) and straight edges 1
- starting at 23 and interior(2003) and straight edges 1
- SDO_ORDINATES:
(1,1,
1,2, 2,1,
2,2, 3,2, 3,3, 2,3, 2,2
5,1, 5,5, 9,5, 5,1,
5,3, 6,4, 6,3, 5,3)
SQL:
MDSYS.SDO_GEOMETRY(
2004,
NULL,
NULL,
MDSYS.SDO_ELEM_INFO_ARRAY(1,1,1, 3,2,1, 7,1003,1, 17,1003,1, 25,2003,1),
MDSYS.SDO_ORDINATE_ARRAY(
1,1,
1,2, 2,1,
2,2, 3,2, 3,3, 2,3, 2,2,
5,1, 5,5, 9,5, 5,1,
5,3, 6,4, 6,3, 5,3
)
)
|
createLineString | protected LineString createLineString()(Code) | | LineString geometry for testing fixture.
+4,7
|
|
|
1,2+ +4,2
\ /
2,1+-+3,1
Expected Encoding:
- SDO_GTYPE:
2002
2 dimensional, 0 measures, 02 for Line
- SDO_SRID:
NULL
- SDO_POINT:
NULL
- SDO_ELEM_INFO:
(1,2,5)
- SDO_ORDINATES:
(1,2, 2,1, 3,1, 4,2 4,7)
SQL:
MDSYS.SDO_GEOMETRY(
2002,
NULL,
NULL,
(1,2,5),
(1,2, 2,1, 3,1, 4,2 4,7)
)
|
createMultiLineString | protected MultiLineString createMultiLineString()(Code) | | MultiLineString geometry for testing fixture.
2,7+==+==+5,7
|4,7
|
|
1,2+ +4,2
\ /
2,1+-+3,1
Expected Encoding:
- SDO_GTYPE:
2005
2 dimensional, 0 measures, 05 for MultiLine
- SDO_SRID:
NULL
- SDO_POINT:
NULL
- SDO_ELEM_INFO:
(1,2,1,11,2,1)
Two triplets
- (1,2,1): linestring(2) of straight lines(1) starting at 1
- (11,2,1): linestring(2) of straight lines(1) starting at 1
- SDO_ORDINATES:
(1,2, 2,1, 3,1, 4,2 4,7,
2,7, 4,7, 5,7)
SQL:
MDSYS.SDO_GEOMETRY(
2005,
NULL,
NULL,
(1,2,1,11,2,1),
(1,2, 2,1, 3,1, 4,2 4,7, 2,7, 4,7, 5,7)
)
|
createMultiPoint | protected MultiPoint createMultiPoint()(Code) | | MultiPoint geometry for testing fixture.
5,5+
3,3+
2,2+
1,1+
Expected Encoding:
- SDO_GTYPE:
2004
2 dimensional, 0 measures, 05 for MultiPoint
- SDO_SRID:
NULL
- SDO_POINT:
NULL
- SDO_ELEM_INFO:
(1,1,4)
- SDO_ORDINATES:
(1,1, 2,2, 3,3, 5,5)
SQL:
MDSYS.SDO_GEOMETRY(
2005,
NULL,
NULL,
(1,1,4),
(1,1, 2,2, 3,3, 5,5)
)
|
createMultiPolygon | protected MultiPolygon createMultiPolygon()(Code) | | Construct a multipolyugon with a square and a triangle.
Used to illustrate multi polyugon encoding.
2,9+------+7,9
| | +11,8
| | / \
| | / \
| |9,5-----+13,5
| |
2,3+------+7,3
A MultiPolygon with expected encoding:
- SDO_GTYPE:
2006
2 dimensional polygon, 6 for multi polygon
- SDO_SRID:
NULL
- SDO_POINT:NULL>
- SDO_ELEM_INFO:
(1,1003,1,11,1003,1)
Three triplets
- (1,1003,1): exterior(1000) polygon(3) starting at 1 with
straight edges(1)
- (11,1003,1): exterior(1000) polygon(3) starting at 11 with
straight edges(1)
- SDO_ORDINATES:
(2,3, 7,3, 7,9, 2,9, 2,3,
9,5, 13,5, 11,5, 9,5)
SQL:
MDSYS.SDO_GEOMETRY(
2006,
NULL,
NULL,
MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1, 11,1003,1),
MDSYS.SDO_ORDINATE_ARRAY(2,3, 7,3, 7,9, 2,9, 2,3,
9,5, 13,5, 11,5, 9,5)
)
|
createMultiPolygonWithHole | protected MultiPolygon createMultiPolygonWithHole()(Code) | | Construct a multipolyugon with a square with a hole and a triangle.
Used to illustrate multi polyugon encoding.
2,9+-------+7,9
|3,8 6,8| +11,8
| +---+ | / \
| | / | / \
| | / | / \
| + |9,5+-------+13,5
|3,4 |
2,3+-------+7,3
A MultiPolygon with expected encoding:
- SDO_GTYPE:
2007
2 dimensional, 6 for multipolygon
- SDO_SRID:
0
- SDO_POINT:NULL>
- SDO_ELEM_INFO:
(1,1003,1,11,2003,1,19,1003,1)
Two triplets
- (1,1003,1): exterior(1000) polygon(3) starting at 1 with
straight edges(1)
- (1,2003,1): interior(2000) polygon(3) starting at 11 with
straight edges(1)
- (11,1003,1): exterior(1000) polygon(3) starting at 19 with
straight edges(1)
- SDO_ORDINATES:
(2,3, 7,3, 7,9, 2,9, 2,3,
3,4, 3,8, 6,8, 3,4,
9,5, 13,5, 11,8, 9,5)
SQL:
MDSYS.SDO_GEOMETRY(
2006,
NULL,
NULL,
MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1,11,2003,1,19,1003,1),
MDSYS.SDO_ORDINATE_ARRAY(2,3, 7,3, 7,9, 2,9, 2,3,
3,4, 3,8, 6,8, 3,4,
9,5, 13,5, 11,8, 9,5)
)
|
createPoint | protected Point createPoint()(Code) | | Geometry Example "2.3.5 Point".
Simple Point used to test POINT_TYPE array use.
+ 12,14
Expected Encoding:
- SDO_GTYPE:
2001
2 dimensional, 0 measures, 01 for point
- SDO_SRID:
NULL
- SDO_POINT:
(12,14,NULL)
- SDO_ELEM_INFO:
(1,1,1)
- SDO_ORDINATES:
(12,14)
SQL:
MDSYS.SDO_GEOMETRY(
2001,
NULL,
MDSYS.SDO_POINT_TYPE(12, 14, NULL),
NULL,
NULL
)
|
createPolygon | protected Polygon createPolygon()(Code) | | Construct a polygon of a triangle.
Used to illustrate polyugon encoding.
+11,8
/ \
/ \
/ \
9,5+-------+13,5
A Rectangle with expected encoding:
- SDO_GTYPE:
2003
2 dimensional polygon
- SDO_SRID:
NULL
- SDO_POINT:NULL>
- SDO_ELEM_INFO:
(1,1003,1)
1000 for external, 03 for polygon,
1 indicates this polygon uses strait edges
- SDO_ORDINATES:
(1,1,5,7)
bottom left and upper right
SQL:
MDSYS.SDO_GEOMETRY(
2003,
NULL,
NULL,
MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),
MDSYS.SDO_ORDINATE_ARRAY(9,5, 13,5, 11,8, 9,5)
)
|
createPolygonWithHole | protected Polygon createPolygonWithHole()(Code) | | Construct a polygon with hole according to Geometry Examples 2.3.2.
Polygon examples used to illustrate compound encoding.
5,13+-------------+ 11,13
/ \
2,11+ \
| 7,10+----+10,10 \
| | | +13,9
| | | |
| | | |
| 7,5+----+10,5 +13,5
2,4+ /
\ /
4,3+---------------+10,3
A Polygon with expected encoding:
- SDO_GTYPE:
2003
2 dimensional polygon, 3 for polygon
- SDO_SRID:
NULL
- SDO_POINT:NULL>
- SDO_ELEM_INFO:
(1,1003,1,19,2003,1)
Two triplets
- (1,1003,1): exterior polygon ring starting at 1
- (19,2003,1): interior polygon ring starting at 19
- SDO_ORDINATES:
(2,4, 4,3, 10,3, 13,5, 13,9, 11,13, 5,13, 2,11, 2,4,
7,5, 7,10, 10,10, 10,5, 7,5)
SQL:
MDSYS.SDO_GEOMETRY(
2003,
NULL,
NULL,
MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1, 19,2003,1),
MDSYS.SDO_ORDINATE_ARRAY(2,4, 4,3, 10,3, 13,5, 13,9, 11,13, 5,13, 2,11, 2,4,
7,5, 7,10, 10,10, 10,5, 7,5)
)
|
createRectangle | protected Polygon createRectangle()(Code) | | Construct a rectangle according to Geometry Examples "2.3.1 Rectangle".
A simple rectangle as used with CAD applications
(1,7) (5,7)
+-------------+
| |
| |
+-------------+
(1,1) (5,1)
The polygon is not consturcted with an SRID (ie srid == -1)
A Rectangle with expected encoding:
- SDO_GTYPE:
2003
2 dimensional polygon
- SDO_SRID:
NULL
- SDO_POINT:NULL>
- SDO_ELEM_INFO:
(1,1003,3)
03 indicates this is a rectangle
- SDO_ORDINATES:
(1,1,5,7)
bottom left and upper right
SQL:
MDSYS.SDO_GEOMETRY(
2003,
NULL,
NULL,
MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),
MDSYS.SDO_ORDINATE_ARRAY(1,1,5,7)
)
See Also: GeometryFixture.rectangle
|
ring | protected LinearRing ring(double coords)(Code) | | |
|
|