Package org.h2.util.geometry
Class EWKTUtils.EWKTTarget
java.lang.Object
org.h2.util.geometry.GeometryUtils.Target
org.h2.util.geometry.EWKTUtils.EWKTTarget
- Enclosing class:
- EWKTUtils
Converter output target that writes a EWKT.
-
Constructor Summary
ConstructorsConstructorDescriptionEWKTTarget(StringBuilder output, int dimensionSystem) Creates a new EWKT output target. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddCoordinate(double x, double y, double z, double m, int index, int total) Invoked to add a coordinate to a geometry.protected voidendCollectionItem(GeometryUtils.Target target, int type, int index, int total) Invoked after writing of a collection item.protected voidInvoked after writing of non-empty POLYGON.protected voidendObject(int type) Invoked after writing of the object.protected voidinit(int srid) Initializes top-level target.protected voidstartCollection(int type, int numItems) Invoked before writing of a collection.protected GeometryUtils.TargetstartCollectionItem(int index, int total) Invoked before writing of a collection item.protected voidstartLineString(int numPoints) Invoked before writing a LINESTRING.protected voidInvoked before writing a POINT.protected voidstartPolygon(int numInner, int numPoints) Invoked before writing a POLYGON.protected voidstartPolygonInner(int numInner) Invoked before writing an inner polygon in POLYGON.Methods inherited from class org.h2.util.geometry.GeometryUtils.Target
dimensionSystem
-
Constructor Details
-
EWKTTarget
Creates a new EWKT output target.- Parameters:
output- output streamdimensionSystem- dimension system to use
-
-
Method Details
-
init
protected void init(int srid) Description copied from class:GeometryUtils.TargetInitializes top-level target.- Overrides:
initin classGeometryUtils.Target- Parameters:
srid- SRID
-
startPoint
protected void startPoint()Description copied from class:GeometryUtils.TargetInvoked before writing a POINT.- Overrides:
startPointin classGeometryUtils.Target
-
startLineString
protected void startLineString(int numPoints) Description copied from class:GeometryUtils.TargetInvoked before writing a LINESTRING.- Overrides:
startLineStringin classGeometryUtils.Target- Parameters:
numPoints- number of points in line string
-
startPolygon
protected void startPolygon(int numInner, int numPoints) Description copied from class:GeometryUtils.TargetInvoked before writing a POLYGON. If polygon is empty, both parameters are 0.- Overrides:
startPolygonin classGeometryUtils.Target- Parameters:
numInner- number of inner polygonsnumPoints- number of points in outer polygon
-
startPolygonInner
protected void startPolygonInner(int numInner) Description copied from class:GeometryUtils.TargetInvoked before writing an inner polygon in POLYGON.- Overrides:
startPolygonInnerin classGeometryUtils.Target- Parameters:
numInner- number of points in inner polygon
-
endNonEmptyPolygon
protected void endNonEmptyPolygon()Description copied from class:GeometryUtils.TargetInvoked after writing of non-empty POLYGON.- Overrides:
endNonEmptyPolygonin classGeometryUtils.Target
-
startCollection
protected void startCollection(int type, int numItems) Description copied from class:GeometryUtils.TargetInvoked before writing of a collection.- Overrides:
startCollectionin classGeometryUtils.Target- Parameters:
type- type of collection, one ofGeometryUtils.MULTI_POINT,GeometryUtils.MULTI_LINE_STRING,GeometryUtils.MULTI_POLYGON,GeometryUtils.GEOMETRY_COLLECTIONnumItems- number of items in this collection
-
startCollectionItem
Description copied from class:GeometryUtils.TargetInvoked before writing of a collection item.- Overrides:
startCollectionItemin classGeometryUtils.Target- Parameters:
index- 0-based index of this item in the collectiontotal- total number of items in the collection- Returns:
- output target that should be used for processing of this collection item. May return this target or an custom sub-target.
-
endCollectionItem
Description copied from class:GeometryUtils.TargetInvoked after writing of a collection item. This method is invoked on the same target that was used forGeometryUtils.Target.startCollectionItem(int, int).- Overrides:
endCollectionItemin classGeometryUtils.Target- Parameters:
target- the result ofGeometryUtils.Target.startCollectionItem(int, int)type- type of collectionindex- 0-based index of this item in the collectiontotal- total number of items in the collection
-
endObject
protected void endObject(int type) Description copied from class:GeometryUtils.TargetInvoked after writing of the object.- Overrides:
endObjectin classGeometryUtils.Target- Parameters:
type- type of the object
-
addCoordinate
protected void addCoordinate(double x, double y, double z, double m, int index, int total) Description copied from class:GeometryUtils.TargetInvoked to add a coordinate to a geometry.- Specified by:
addCoordinatein classGeometryUtils.Target- Parameters:
x- X coordinatey- Y coordinatez- Z coordinate (NaN if not used)m- M coordinate (NaN if not used)index- 0-based index of coordinate in the current sequencetotal- total number of coordinates in the current sequence
-