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.
| Modifier and Type | Class and Description |
|---|---|
| private static class | EWKTUtils.
Helper source object for EWKT reading. |
| public static class | EWKTUtils.
Converter output target that writes a EWKT. |
| Modifier and Type | Field and Description |
|---|---|
| private static final String[] | DIMENSION_SYSTEMS
Names of dimension systems. |
| pack-priv static final String[] | TYPES
0-based type names of geometries, subtract 1 from type code to get index in this array. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static void | addCoordinate(EWKTUtils.
|
| private static void | |
| public static String | |
| public static String | Returns: EWKT representationsource EWKB ewkb, int dimension system dimensionSystem)Converts EWKB to EWKT. |
| public static byte[] | |
| public static byte[] | |
| public static StringBuilder | Returns: the specified string builderstring builder builder, int OGC geometry code format (type + dimensionSystem * 1000) type)Formats type and dimension system as a string. |
| public static int | Returns: the dimension systemEWKT source ewkt)Reads the dimension system from EWKT. |
| private static void | parseCollection(EWKTUtils.
|
| public static int | Returns: dimension system, one of XYZ, XYM, or XYZMstring to parse s)Parses a dimension system from the given string. |
| public static void | |
| private static void | parseEWKT(EWKTUtils.
EWKT source source,output target target,type of parent geometry collection, or 0 for the root geometry parentType, int dimension system of parent geometry dimensionSystem)Parses a EWKB. |
| public static int | Returns: geometry type and dimension system in OGC geometry code format (type + dimensionSystem * 1000)string to parse s)Parses geometry type and dimension system from the given string. |
| private static void | parseMultiPointAlternative(EWKTUtils.
|
| private static double[] | |
| private static ArrayList |
| DIMENSION_SYSTEMS | back to summary |
|---|---|
| private static final String[] DIMENSION_SYSTEMS Names of dimension systems. | |
| TYPES | back to summary |
|---|---|
| pack-priv static final String[] TYPES 0-based type names of geometries, subtract 1 from type code to get index in this array. | |
| EWKTUtils | back to summary |
|---|---|
| private EWKTUtils() | |
| addCoordinate | back to summary |
|---|---|
| private static void addCoordinate(EWKTUtils. | |
| addRing | back to summary |
|---|---|
| private static void addRing(ArrayList<double[]> ring, GeometryUtils. | |
| ewkb2ewkt | back to summary |
|---|---|
| public static String ewkb2ewkt(byte[] ewkb) Converts EWKB to EWKT.
| |
| ewkb2ewkt | back to summary |
|---|---|
| public static String ewkb2ewkt(byte[] ewkb, int dimensionSystem) Converts EWKB to EWKT.
| |
| ewkt2ewkb | back to summary |
|---|---|
| public static byte[] ewkt2ewkb(String ewkt) Converts EWKT to EWKB.
| |
| ewkt2ewkb | back to summary |
|---|---|
| public static byte[] ewkt2ewkb(String ewkt, int dimensionSystem) Converts EWKT to EWKB.
| |
| formatGeometryTypeAndDimensionSystem | back to summary |
|---|---|
| public static StringBuilder formatGeometryTypeAndDimensionSystem(StringBuilder builder, int type) Formats type and dimension system as a string.
| |
| getDimensionSystem | back to summary |
|---|---|
| public static int getDimensionSystem(String ewkt) Reads the dimension system from EWKT.
| |
| parseCollection | back to summary |
|---|---|
| private static void parseCollection(EWKTUtils. | |
| parseDimensionSystem | back to summary |
|---|---|
| public static int parseDimensionSystem(String s) Parses a dimension system from the given string.
| |
| parseEWKT | back to summary |
|---|---|
| public static void parseEWKT(String ewkt, GeometryUtils. Parses a EWKT.
| |
| parseEWKT | back to summary |
|---|---|
| private static void parseEWKT(EWKTUtils. Parses a EWKB.
| |
| parseGeometryType | back to summary |
|---|---|
| public static int parseGeometryType(String s) Parses geometry type and dimension system from the given string.
| |
| parseMultiPointAlternative | back to summary |
|---|---|
| private static void parseMultiPointAlternative(EWKTUtils. | |
| readCoordinate | back to summary |
|---|---|
| private static double[] readCoordinate(EWKTUtils. | |
| readRing | back to summary |
|---|---|
| private static ArrayList | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| pack-priv int | |
| public boolean | |
| pack-priv boolean | |
| public boolean | |
| private static boolean | |
| private static boolean | |
| private int | |
| pack-priv void | |
| public double | |
| pack-priv int | |
| pack-priv boolean | |
| pack-priv int | |
| pack-priv int | |
| private void | |
| public String |
| EWKTSource | back to summary |
|---|---|
| pack-priv EWKTSource(String ewkt) | |
| checkStringEnd | back to summary |
|---|---|
| private void checkStringEnd(int len) | |
| getItemCount | back to summary |
|---|---|
| pack-priv int getItemCount() | |
| hasCoordinate | back to summary |
|---|---|
| public boolean hasCoordinate() | |
| hasData | back to summary |
|---|---|
| pack-priv boolean hasData() | |
| hasMoreCoordinates | back to summary |
|---|---|
| public boolean hasMoreCoordinates() | |
| isNumberPart | back to summary |
|---|---|
| private static boolean isNumberPart(char ch) | |
| isNumberStart | back to summary |
|---|---|
| private static boolean isNumberStart(char ch) | |
| match | back to summary |
|---|---|
| private int match(String token, int code) | |
| read | back to summary |
|---|---|
| pack-priv void read(char symbol) | |
| readCoordinate | back to summary |
|---|---|
| public double readCoordinate() | |
| readDimensionSystem | back to summary |
|---|---|
| pack-priv int readDimensionSystem() | |
| readEmpty | back to summary |
|---|---|
| pack-priv boolean readEmpty() | |
| readSRID | back to summary |
|---|---|
| pack-priv int readSRID() | |
| readType | back to summary |
|---|---|
| pack-priv int readType() | |
| skipWS | back to summary |
|---|---|
| private void skipWS() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private boolean | |
| private final StringBuilder | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | EWKTTarget(StringBuilder
output stream output, int dimension system to use dimensionSystem)Creates a new EWKT output target. |
| Modifier and Type | Method and Description |
|---|---|
| protected void | addCoordinate(double
X coordinate x, double Y coordinate y, double Z coordinate (NaN if not used) z, double M coordinate (NaN if not used) m, int 0-based index of coordinate in the current sequence index, int total number of coordinates in the current sequence total)Implements abstract org. Invoked to add a coordinate to a geometry. |
| protected void | endCollectionItem(GeometryUtils.
the result of target,startCollectionItem(int, int)type of collection type, int 0-based index of this item in the collection index, int total number of items in the collection total)Overrides org. Invoked after writing of a collection item. |
| protected void | endNonEmptyPolygon()
Overrides org. Invoked after writing of non-empty POLYGON. |
| protected void | endObject(int
type of the object type)Overrides org. Invoked after writing of the object. |
| protected void | init(int
SRID srid)Overrides org. Initializes top-level target. |
| protected void | startCollection(int
type of collection, one of
type, int GeometryUtils#MULTI_POINT,
GeometryUtils#MULTI_LINE_STRING,
GeometryUtils#MULTI_POLYGON,
GeometryUtils#GEOMETRY_COLLECTIONnumber of items in this collection numItems)Overrides org. Invoked before writing of a collection. |
| protected GeometryUtils. | startCollectionItem(int
0-based index of this item in the collection index, int total number of items in the collection total)Overrides org. Invoked before writing of a collection item. |
| protected void | startLineString(int
number of points in line string numPoints)Overrides org. Invoked before writing a LINESTRING. |
| protected void | startPoint()
Overrides org. Invoked before writing a POINT. |
| protected void | startPolygon(int
number of inner polygons numInner, int number of points in outer polygon numPoints)Overrides org. Invoked before writing a POLYGON. |
| protected void | startPolygonInner(int
number of points in inner polygon numInner)Overrides org. Invoked before writing an inner polygon in POLYGON. |
| private void | |
| private void |
| dimensionSystem | back to summary |
|---|---|
| private final int dimensionSystem | |
| inMulti | back to summary |
|---|---|
| private boolean inMulti | |
| output | back to summary |
|---|---|
| private final StringBuilder output | |
| type | back to summary |
|---|---|
| private int type | |
| EWKTTarget | back to summary |
|---|---|
| public EWKTTarget(StringBuilder output, int dimensionSystem) Creates a new EWKT output target.
| |
| addCoordinate | back to summary |
|---|---|
| protected void addCoordinate(double x, double y, double z, double m, int index, int total) Implements abstract org. Doc from org. Invoked to add a coordinate to a geometry.
| |
| endCollectionItem | back to summary |
|---|---|
| protected void endCollectionItem(GeometryUtils. Overrides org. Doc from org. Invoked after writing of a collection item. This method is invoked on
the same target that was used for
| |
| endNonEmptyPolygon | back to summary |
|---|---|
| protected void endNonEmptyPolygon() Overrides org. Doc from org. Invoked after writing of non-empty POLYGON.
| |
| endObject | back to summary |
|---|---|
| protected void endObject(int type) Overrides org. Doc from org. Invoked after writing of the object.
| |
| init | back to summary |
|---|---|
| protected void init(int srid) Overrides org. Doc from org. Initializes top-level target.
| |
| startCollection | back to summary |
|---|---|
| protected void startCollection(int type, int numItems) Overrides org. Doc from org. Invoked before writing of a collection.
| |
| startCollectionItem | back to summary |
|---|---|
| protected GeometryUtils. Overrides org. Doc from org. Invoked before writing of a collection item.
| |
| startLineString | back to summary |
|---|---|
| protected void startLineString(int numPoints) Overrides org. Doc from org. Invoked before writing a LINESTRING.
| |
| startPoint | back to summary |
|---|---|
| protected void startPoint() Overrides org. Doc from org. Invoked before writing a POINT.
| |
| startPolygon | back to summary |
|---|---|
| protected void startPolygon(int numInner, int numPoints) Overrides org. Doc from org. Invoked before writing a POLYGON. If polygon is empty, both parameters are 0.
| |
| startPolygonInner | back to summary |
|---|---|
| protected void startPolygonInner(int numInner) Overrides org. Doc from org. Invoked before writing an inner polygon in POLYGON.
| |
| writeDouble | back to summary |
|---|---|
| private void writeDouble(double v) | |
| writeHeader | back to summary |
|---|---|
| private void writeHeader(int type) | |