|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.wkb4j.factories.AbstractWKBFactory | +--org.wkb4j.jts.JTSFactory
This class has the capability to transform data in the WKB format into
JTS objects. Since JTS conforms to the
Simple Features Specification for SQL
published by the Open GIS Consortium,
the mapping is straighforward: each feature described in the WKB is mapped to a corresponding feature in
JTS.
You can download the JTS library from
http://www.vividsolutions.com/JTS/jts_frame.htm.
Implementation notes:
Creation date: 6 juil. 2002 23:10:29
Field Summary | |
private com.vividsolutions.jts.geom.Coordinate[] |
coordinatesBuffer
Stores a array of Coordinates objects. |
private com.vividsolutions.jts.geom.Geometry |
currentGeometry
The Geometry being constructed now. |
private java.util.ArrayList |
geometries
Keeps a list of all the object created by this Factory. |
private com.vividsolutions.jts.geom.Geometry[] |
geometryBuffer
Stores a array of Geometry objects. |
private int |
geometryPointer
Points to the next free slot in the geometryBuffer. |
private com.vividsolutions.jts.geom.LinearRing[] |
linearRingBuffer
Stores a array of LinearRing objects. |
private int |
linearRingPointer
Points to the next free slot in the linearRingBuffer. |
private com.vividsolutions.jts.geom.LineString[] |
lineStringBuffer
Stores a array of LineString objects. |
private int |
lineStringPointer
Points to the next free slot in the lineStringBuffer. |
protected static org.apache.log4j.Logger |
log
|
private int |
newSrid
Transient SRID used for the next Geometries. |
private com.vividsolutions.jts.geom.Point[] |
pointBuffer
Stores a array of Point objects. |
private int |
pointPointer
Points to the next free slot in the pointBuffer. |
private com.vividsolutions.jts.geom.Polygon[] |
polygonBuffer
Stores a array of Polygon objects. |
private int |
polygonPointer
Points to the next free slot in the polygonBuffer. |
private com.vividsolutions.jts.geom.PrecisionModel |
precisionModel
The PrecisionModel used to built every Geometry. |
private int |
srid
The SRID of the top-level Geometry being created. |
Fields inherited from class org.wkb4j.factories.AbstractWKBFactory |
depthPointer, geometryDepth, inUnit, inWork, typeStack, values, words |
Fields inherited from interface org.wkb4j.engine.WKBGeometryTypes |
linearRing, wkbGeometryCollection, wkbLineString, wkbMultiLineString, wkbMultiPoint, wkbMultiPolygon, wkbPoint, wkbPolygon |
Constructor Summary | |
JTSFactory()
Construct a JTSFactory. |
|
JTSFactory(com.vividsolutions.jts.geom.PrecisionModel pm)
Construct a JTSFactory. |
Method Summary | |
void |
abortGeometryCollection()
Signals a malformed GeometryCollection . |
void |
abortLineString()
Signals a malformed LineString . |
void |
abortPoint()
Signals a malformed Point . |
boolean |
addPoints(double[] points)
Transforms an array of points in an array of Coordinates. |
boolean |
addPoints3D(double[] points)
Transforms an array of points in an array of Coordinates in 3D. |
boolean |
beginGeometryCollection(int count)
Signals the beginning of a new GeometryCollection . |
boolean |
beginLinearRing(int count)
Constructs a new array of Coordinates with the supplied number of elements. |
boolean |
beginMultiLineString(int count)
Constructs a new array of LineStrings with the supplied number of elements. |
boolean |
beginMultiPoint(int count)
Constructs a new array of Points with the supplied number of elements. |
boolean |
beginMultiPolygon(int count)
Constructs a new array of Polygons with the supplied number of elements. |
boolean |
beginPolygon(int count)
Constructs a new array of LinearRings with the supplied number of elements. |
void |
beginUnit(int srid)
Signals the beginning of the transcription process for a Geometry .
|
void |
beginUnit(java.lang.String[] words,
int[] values)
Signals the beginning of the transcription process for a Geometry .
|
boolean |
endGeometryCollection()
Signals the end of a GeometryCollection . |
boolean |
endLinearRing()
Constructs a LinearRing using the current buffer of Coordinates, resets the Coordinates buffer, add the LinearRing to the linearRingBuffer and defines the new LineString as the currentGeometry. |
boolean |
endLineString()
Constructs a LineString using the current buffer of Coordinates, resets the Coordinates buffer, add the LineString to the lineStringBuffer and defines the new LineString as the currentGeometry. |
boolean |
endMultiLineString()
Constructs a MultiLineString using the current buffer of LineStrings, resets the LineStrings buffer and defines the new MultiLineString as the currentGeometry. |
boolean |
endMultiPoint()
Constructs a MultiPoint using the current buffer of Points, resets the Points buffer and defines the new MultiPoint as the currentGeometry. |
boolean |
endMultiPolygon()
Constructs a MultiPolygon using the current buffer of LinearRings, resets the LinearRings buffer and defines the new LineString as the currentGeometry. |
boolean |
endPoint()
Constructs a Point using the current buffer of Coordinates, resets the Coordinates buffer, add the Point to the PointBuffer and defines the new Point as the currentGeometry. |
boolean |
endPolygon()
Constructs a Polygon using the current buffer of LinearRings, resets the LinearRings buffer, add the Polygon to the polygonBuffer and defines the new Polygon as the currentGeometry. |
void |
endUnit()
Signals the end of the transcription process for a Geometry . |
java.util.ArrayList |
getGeometries()
Returns the geometries. |
com.vividsolutions.jts.geom.PrecisionModel |
getPrecisionModel()
Returns the precisionModel. |
int |
getSrid()
Returns the SRID used to construct the current Geometry. |
boolean |
newGeometryCollectionComponent()
Signals that a new component for the geometry factory is about to processed OR that all components has been used. |
void |
reset()
|
void |
setPrecisionModel(com.vividsolutions.jts.geom.PrecisionModel precisionModel)
Sets the precisionModel. |
private void |
setSrid(int srid)
Sets the SRID used to construct Geometries. |
Methods inherited from class org.wkb4j.factories.AbstractWKBFactory |
abortLinearRing, abortMultiLineString, abortMultiPoint, abortMultiPolygon, abortPolygon, abortUnit, abortWork, beginLineString, beginPoint, beginWork, endWork, getValues, getWords, init, setValues, setWords |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static org.apache.log4j.Logger log
private com.vividsolutions.jts.geom.PrecisionModel precisionModel
private com.vividsolutions.jts.geom.Coordinate[] coordinatesBuffer
private com.vividsolutions.jts.geom.LineString[] lineStringBuffer
private com.vividsolutions.jts.geom.Polygon[] polygonBuffer
private com.vividsolutions.jts.geom.LinearRing[] linearRingBuffer
private com.vividsolutions.jts.geom.Point[] pointBuffer
private com.vividsolutions.jts.geom.Geometry[] geometryBuffer
private volatile int lineStringPointer
private volatile int polygonPointer
private volatile int linearRingPointer
private volatile int pointPointer
private volatile int geometryPointer
private int srid
private final java.util.ArrayList geometries
private com.vividsolutions.jts.geom.Geometry currentGeometry
private int newSrid
Constructor Detail |
public JTSFactory()
public JTSFactory(com.vividsolutions.jts.geom.PrecisionModel pm)
pm
- PrecisionModel used by this Factory.Method Detail |
public final void beginUnit(java.lang.String[] words, int[] values)
WKBFactory
Geometry
.
The submitted values will be available to all the Geometries contained in this Geometry
beginUnit
in interface WKBFactory
beginUnit
in class AbstractWKBFactory
org.wkb4j.engine.WKBFactory#beginUnit()
public final void beginUnit(int srid)
WKBFactory
Geometry
.
The submitted SRID will be assigned to all the Geometries contained in this Geometry
beginUnit
in interface WKBFactory
beginUnit
in class AbstractWKBFactory
org.wkb4j.engine.WKBFactory#beginUnit()
public final void endUnit()
WKBFactory
Geometry
.
endUnit
in interface WKBFactory
endUnit
in class AbstractWKBFactory
WKBFactory.endUnit()
public final boolean beginGeometryCollection(int count)
WKBFactory
GeometryCollection
.
beginGeometryCollection
in interface WKBFactory
beginGeometryCollection
in class AbstractWKBFactory
org.wkb4j.engine.WKBFactory#beginGeometryCollection()
public final boolean endGeometryCollection()
WKBFactory
GeometryCollection
.
endGeometryCollection
in interface WKBFactory
endGeometryCollection
in class AbstractWKBFactory
WKBFactory.endGeometryCollection()
public final boolean newGeometryCollectionComponent()
WKBFactory
newGeometryCollectionComponent
in interface WKBFactory
newGeometryCollectionComponent
in class AbstractWKBFactory
WKBFactory.abortGeometryCollection()
public final void abortGeometryCollection()
WKBFactory
GeometryCollection
. This can happen at any time,
and Factories should just skip the malformed Geometry
and maybe escalate the error.
abortGeometryCollection
in interface WKBFactory
abortGeometryCollection
in class AbstractWKBFactory
WKBFactory.abortGeometryCollection()
public final boolean endPoint()
endPoint
in interface WKBFactory
endPoint
in class AbstractWKBFactory
WKBFactory.endPoint()
public final void abortPoint()
WKBFactory
Point
. This can happen at any time,
and Factories should just skip the malformed
abortPoint
in interface WKBFactory
abortPoint
in class AbstractWKBFactory
WKBFactory.abortPoint()
public final boolean beginMultiPoint(int count)
beginMultiPoint
in interface WKBFactory
beginMultiPoint
in class AbstractWKBFactory
org.wkb4j.engine.WKBFactory#beginMultiPoint()
public final boolean endMultiPoint()
endMultiPoint
in interface WKBFactory
endMultiPoint
in class AbstractWKBFactory
WKBFactory.endMultiPoint()
public final boolean endLineString()
endLineString
in interface WKBFactory
endLineString
in class AbstractWKBFactory
WKBFactory.endLineString()
public final void abortLineString()
WKBFactory
LineString
. This can happen at any time,
and Factories should just skip the malformed
abortLineString
in interface WKBFactory
abortLineString
in class AbstractWKBFactory
WKBFactory.abortLineString()
public final boolean beginMultiLineString(int count)
beginMultiLineString
in interface WKBFactory
beginMultiLineString
in class AbstractWKBFactory
org.wkb4j.engine.WKBFactory#beginMultiLineString()
public final boolean endMultiLineString()
endMultiLineString
in interface WKBFactory
endMultiLineString
in class AbstractWKBFactory
WKBFactory.endMultiLineString()
public final boolean beginMultiPolygon(int count)
beginMultiPolygon
in interface WKBFactory
beginMultiPolygon
in class AbstractWKBFactory
org.wkb4j.engine.WKBFactory#beginMultiPolygon()
public final boolean endMultiPolygon()
endMultiPolygon
in interface WKBFactory
endMultiPolygon
in class AbstractWKBFactory
WKBFactory.endMultiPolygon()
public final boolean beginPolygon(int count)
beginPolygon
in interface WKBFactory
beginPolygon
in class AbstractWKBFactory
org.wkb4j.engine.WKBFactory#beginPolygon()
public final boolean endPolygon()
endPolygon
in interface WKBFactory
endPolygon
in class AbstractWKBFactory
WKBFactory.endPolygon()
public final boolean beginLinearRing(int count)
beginLinearRing
in interface WKBFactory
beginLinearRing
in class AbstractWKBFactory
org.wkb4j.engine.WKBFactory#beginLinearRing()
public final boolean endLinearRing()
endLinearRing
in interface WKBFactory
endLinearRing
in class AbstractWKBFactory
WKBFactory.endLinearRing()
public final boolean addPoints(double[] points)
addPoints
in interface WKBFactory
addPoints
in class AbstractWKBFactory
WKBFactory.addPoints(double[])
public final boolean addPoints3D(double[] points)
addPoints3D
in interface WKBFactory3D
addPoints3D
in class AbstractWKBFactory
WKBFactory.addPoints(double[])
public final com.vividsolutions.jts.geom.PrecisionModel getPrecisionModel()
public final void setPrecisionModel(com.vividsolutions.jts.geom.PrecisionModel precisionModel)
precisionModel
- The precisionModel to setpublic final java.util.ArrayList getGeometries()
public final int getSrid()
private void setSrid(int srid)
srid
- The SRID to setpublic void reset()
reset
in class AbstractWKBFactory
AbstractWKBFactory.reset()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |