Package org.h2.util.geometry

# Class EWKTUtils

java.lang.Object
org.h2.util.geometry.EWKTUtils

public final class EWKTUtils extends Object
EWKT format support for GEOMETRY data type.

This class provides limited support of EWKT. EWKT is based on Well-known Text Representation (WKT) from OGC 06-103r4 and includes additional PostGIS extensions. SRID support from EWKT is implemented.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static final class`
`EWKTUtils.EWKTTarget`
Converter output target that writes a EWKT.

## Method Summary

Modifier and Type
Method
Description
`static String`
`ewkb2ewkt(byte[] ewkb)`
Converts EWKB to EWKT.
`static String`
`ewkb2ewkt(byte[] ewkb, int dimensionSystem)`
Converts EWKB to EWKT.
`static byte[]`
`ewkt2ewkb(String ewkt)`
Converts EWKT to EWKB.
`static byte[]`
`ewkt2ewkb(String ewkt, int dimensionSystem)`
Converts EWKT to EWKB.
`static StringBuilder`
`formatGeometryTypeAndDimensionSystem(StringBuilder builder, int type)`
Formats type and dimension system as a string.
`static int`
`getDimensionSystem(String ewkt)`
Reads the dimension system from EWKT.
`static int`
`parseDimensionSystem(String s)`
Parses a dimension system from the given string.
`static void`
`parseEWKT(String ewkt, GeometryUtils.Target target)`
Parses a EWKT.
`static int`
`parseGeometryType(String s)`
Parses geometry type and dimension system from the given string.

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

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

## Method Details

### ewkb2ewkt

public static String ewkb2ewkt(byte[] ewkb)
Converts EWKB to EWKT.

Parameters:
  `ewkb` - source EWKB
Returns:
  EWKT representation

### ewkb2ewkt

public static String ewkb2ewkt(byte[] ewkb, int dimensionSystem)
Converts EWKB to EWKT.

Parameters:
  `ewkb` - source EWKB
  `dimensionSystem` - dimension system
Returns:
  EWKT representation

### ewkt2ewkb

public static byte[] ewkt2ewkb(String ewkt)
Converts EWKT to EWKB.

Parameters:
  `ewkt` - source EWKT
Returns:
  EWKB representation

### ewkt2ewkb

public static byte[] ewkt2ewkb(String ewkt, int dimensionSystem)
Converts EWKT to EWKB.

Parameters:
  `ewkt` - source EWKT
  `dimensionSystem` - dimension system
Returns:
  EWKB representation

### parseEWKT

public static void parseEWKT(String ewkt, GeometryUtils.Target target)
Parses a EWKT.

Parameters:
  `ewkt` - source EWKT
  `target` - output target

### parseGeometryType

public static int parseGeometryType(String s)
Parses geometry type and dimension system from the given string.

Parameters:
  `s` - string to parse
Returns:
  geometry type and dimension system in OGC geometry code format (type + dimensionSystem * 1000)
Throws:
  `IllegalArgumentException` - if input is not valid

### parseDimensionSystem

public static int parseDimensionSystem(String s)
Parses a dimension system from the given string.

Parameters:
  `s` - string to parse
Returns:
  dimension system, one of XYZ, XYM, or XYZM
Throws:
  `IllegalArgumentException` - if input is not valid
See Also:
  - `GeometryUtils.DIMENSION_SYSTEM_XYZ`
  - `GeometryUtils.DIMENSION_SYSTEM_XYM`
  - `GeometryUtils.DIMENSION_SYSTEM_XYZM`

### formatGeometryTypeAndDimensionSystem

public static StringBuilder formatGeometryTypeAndDimensionSystem(StringBuilder builder, int type)
Formats type and dimension system as a string.

Parameters:
  `builder` - string builder
  `type` - OGC geometry code format (type + dimensionSystem * 1000)
Returns:
  the specified string builder
Throws:
  `IllegalArgumentException` - if type is not valid

### getDimensionSystem

public static int getDimensionSystem(String ewkt)
Reads the dimension system from EWKT.

Parameters:
  `ewkt` - EWKT source
Returns:
  the dimension system