Package org.h2.util.geometry

# Class GeometryUtils.Target

java.lang.Object
org.h2.util.geometry.GeometryUtils.Target

Direct Known Subclasses:
  `EWKBUtils.EWKBTarget`, `EWKTUtils.EWKTTarget`, `GeoJsonUtils.GeoJsonTarget`, `GeometryUtils.DimensionSystemTarget`, `GeometryUtils.EnvelopeTarget`, `JTSUtils.GeometryTarget`

Enclosing class:
  GeometryUtils

public abstract static class GeometryUtils.Target extends Object
Converter output target.

## Constructor Summary

Constructors
Constructor
Description
`Target()`

## Method Summary

Modifier and Type
Method
Description
`protected abstract void`
`addCoordinate(double x, double y, double z, double m, int index, int total)`
Invoked to add a coordinate to a geometry.
`protected void`
`dimensionSystem(int dimensionSystem)`
Invoked to add dimension system requirement.
`protected void`
`endCollectionItem(GeometryUtils.Target target, int type, int index, int total)`
Invoked after writing of a collection item.
`protected void`
`endNonEmptyPolygon()`
Invoked after writing of non-empty POLYGON.
`protected void`
`endObject(int type)`
Invoked after writing of the object.
`protected void`
`init(int srid)`
Initializes top-level target.
`protected void`
`startCollection(int type, int numItems)`
Invoked before writing of a collection.
`protected GeometryUtils.Target`
`startCollectionItem(int index, int total)`
Invoked before writing of a collection item.
`protected void`
`startLineString(int numPoints)`
Invoked before writing a LINESTRING.
`protected void`
`startPoint()`
Invoked before writing a POINT.
`protected void`
`startPolygon(int numInner, int numPoints)`
Invoked before writing a POLYGON.
`protected void`
`startPolygonInner(int numInner)`
Invoked before writing an inner polygon in POLYGON.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### Target

public Target()

## Method Details

### init

protected void init(int srid)
Initializes top-level target.

Parameters:
  `srid` - SRID

### dimensionSystem

protected void dimensionSystem(int dimensionSystem)
Invoked to add dimension system requirement.

Parameters:
  `dimensionSystem` - dimension system

### startPoint

protected void startPoint()
Invoked before writing a POINT.

### startLineString

protected void startLineString(int numPoints)
Invoked before writing a LINESTRING.

Parameters:
  `numPoints` - number of points in line string

### startPolygon

protected void startPolygon(int numInner, int numPoints)
Invoked before writing a POLYGON. If polygon is empty, both parameters are 0.

Parameters:
  `numInner` - number of inner polygons
  `numPoints` - number of points in outer polygon

### startPolygonInner

protected void startPolygonInner(int numInner)
Invoked before writing an inner polygon in POLYGON.

Parameters:
  `numInner` - number of points in inner polygon

### endNonEmptyPolygon

protected void endNonEmptyPolygon()
Invoked after writing of non-empty POLYGON.

### startCollection

protected void startCollection(int type, int numItems)
Invoked before writing of a collection.

Parameters:
  `type` - type of collection, one of `GeometryUtils.MULTI_POINT`, `GeometryUtils.MULTI_LINE_STRING`, `GeometryUtils.MULTI_POLYGON`, `GeometryUtils.GEOMETRY_COLLECTION`
  `numItems` - number of items in this collection

### startCollectionItem

protected GeometryUtils.Target startCollectionItem(int index, int total)
Invoked before writing of a collection item.

Parameters:
  `index` - 0-based index of this item in the collection
  `total` - 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

protected void endCollectionItem(GeometryUtils.Target target, int type, int index, int total)
Invoked after writing of a collection item. This method is invoked on the same target that was used for `startCollectionItem(int, int)`.

Parameters:
  `target` - the result of `startCollectionItem(int, int)`
  `type` - type of collection
  `index` - 0-based index of this item in the collection
  `total` - total number of items in the collection

### endObject

protected void endObject(int type)
Invoked after writing of the object.

Parameters:
  `type` - type of the object

### addCoordinate

protected abstract void addCoordinate(double x, double y, double z, double m, int index, int total)
Invoked to add a coordinate to a geometry.

Parameters:
  `x` - X coordinate
  `y` - Y coordinate
  `z` - Z coordinate (NaN if not used)
  `m` - M coordinate (NaN if not used)
  `index` - 0-based index of coordinate in the current sequence
  `total` - total number of coordinates in the current sequence