|
|||||||||||
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.postgis.PostGISFactory
This class has the capability to transform data in the WKB format into
PostGIS objects. Since they 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
PostGIS.
Implementation notes:
Field Summary | |
private org.postgis.Point[] |
coordinatesBuffer
Stores a array of Point objects. |
private org.postgis.Geometry |
currentGeometry
The Geometry being constructed now. |
private java.util.ArrayList |
geometries
Keeps a list of all the object created by this Factory. |
private org.postgis.Geometry[] |
geometryBuffer
|
private int |
geometryPointer
Points to the next free slot in the pointsBuffer. |
private org.postgis.LinearRing[] |
linearRingBuffer
Stores a array of LinearRing objects. |
private int |
linearRingPointer
Points to the next free slot in the linearRingBuffer. |
private org.postgis.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 org.postgis.Point[] |
pointsBuffer
Stores a array of Point objects, for MultiPoint. |
private int |
pointsPointer
Points to the next free slot in the pointsBuffer. |
private org.postgis.Polygon[] |
polygonBuffer
Stores a array of Polygon objects. |
private int |
polygonPointer
Points to the next free slot in the polygonBuffer. |
private int |
srid
The SRID of the top-level Geometry being created. |
Fields inherited from class org.wkb4j.factories.AbstractWKBFactory |
depthPointer, geometryDepth, inUnit, inWork, log, typeStack, values, words |
Fields inherited from interface org.wkb4j.engine.WKBGeometryTypes |
linearRing, wkbGeometryCollection, wkbLineString, wkbMultiLineString, wkbMultiPoint, wkbMultiPolygon, wkbPoint, wkbPolygon |
Constructor Summary | |
PostGISFactory()
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 Points. |
boolean |
addPoints3D(double[] points)
Transforms an array of doubles into an array of 3D Point objects. |
boolean |
beginGeometryCollection(int count)
Signals the beginning of a new GeometryCollection . |
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. |
boolean |
endGeometryCollection()
Signals the end of a GeometryCollection . |
boolean |
endLinearRing()
Constructs a LinearRing using the current buffer of Points, resets the Points 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 Points, resets the Points 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. |
boolean |
newGeometryCollectionComponent()
Signals that a new component for the geometry factory is about to processed OR that all components has been used. |
void |
reset()
|
Methods inherited from class org.wkb4j.factories.AbstractWKBFactory |
abortLinearRing, abortMultiLineString, abortMultiPoint, abortMultiPolygon, abortPolygon, abortUnit, abortWork, beginLinearRing, beginLineString, beginPoint, beginUnit, beginUnit, 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 org.postgis.Point[] coordinatesBuffer
private org.postgis.Point[] pointsBuffer
private org.postgis.LineString[] lineStringBuffer
private org.postgis.Polygon[] polygonBuffer
private org.postgis.LinearRing[] linearRingBuffer
private org.postgis.Geometry[] geometryBuffer
private volatile int lineStringPointer
private volatile int polygonPointer
private volatile int linearRingPointer
private volatile int pointsPointer
private volatile int geometryPointer
private int srid
private final java.util.ArrayList geometries
private org.postgis.Geometry currentGeometry
Constructor Detail |
public PostGISFactory()
Method Detail |
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 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 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 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 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 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 java.util.ArrayList getGeometries()
public void reset()
reset
in class AbstractWKBFactory
AbstractWKBFactory.reset()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |