Package org.locationtech.jtstest.util.io
Class MultiFormatReader
- java.lang.Object
-
- org.locationtech.jtstest.util.io.MultiFormatReader
-
public class MultiFormatReader extends java.lang.Object
Reads aGeometry
from a string which is in either WKT, WKBHex or GML format- Version:
- 1.7
-
-
Field Summary
Fields Modifier and Type Field Description private static int
FORMAT_GEOJSON
static int
FORMAT_GML
static int
FORMAT_UNKNOWN
static int
FORMAT_WKB
static int
FORMAT_WKT
private GeometryFactory
geomFactory
private static int
MAX_CHARS_TO_CHECK
private WKBReader
wkbReader
private WKTReader
wktReader
-
Constructor Summary
Constructors Constructor Description MultiFormatReader()
MultiFormatReader(GeometryFactory geomFactory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static int
format(java.lang.String s)
static boolean
isGeoJSON(java.lang.String str)
static boolean
isGML(java.lang.String str)
private static boolean
isHex(java.lang.String str, int maxCharsToTest)
private static boolean
isHexDigit(char ch)
static boolean
isWKB(java.lang.String str)
static boolean
isWKT(java.lang.String s)
Geometry
read(java.lang.String geomStr)
private Geometry
readGeoJSON(java.lang.String str)
private Geometry
readGML(java.lang.String str)
-
-
-
Field Detail
-
FORMAT_UNKNOWN
public static final int FORMAT_UNKNOWN
- See Also:
- Constant Field Values
-
FORMAT_WKT
public static final int FORMAT_WKT
- See Also:
- Constant Field Values
-
FORMAT_WKB
public static final int FORMAT_WKB
- See Also:
- Constant Field Values
-
FORMAT_GML
public static final int FORMAT_GML
- See Also:
- Constant Field Values
-
FORMAT_GEOJSON
private static final int FORMAT_GEOJSON
- See Also:
- Constant Field Values
-
MAX_CHARS_TO_CHECK
private static final int MAX_CHARS_TO_CHECK
- See Also:
- Constant Field Values
-
geomFactory
private GeometryFactory geomFactory
-
wktReader
private WKTReader wktReader
-
wkbReader
private WKBReader wkbReader
-
-
Constructor Detail
-
MultiFormatReader
public MultiFormatReader()
-
MultiFormatReader
public MultiFormatReader(GeometryFactory geomFactory)
-
-
Method Detail
-
isWKT
public static boolean isWKT(java.lang.String s)
-
isWKB
public static boolean isWKB(java.lang.String str)
-
isGML
public static boolean isGML(java.lang.String str)
-
isGeoJSON
public static boolean isGeoJSON(java.lang.String str)
-
format
public static int format(java.lang.String s)
-
isHex
private static boolean isHex(java.lang.String str, int maxCharsToTest)
-
isHexDigit
private static boolean isHexDigit(char ch)
-
read
public Geometry read(java.lang.String geomStr) throws ParseException, java.io.IOException
- Throws:
ParseException
java.io.IOException
-
readGeoJSON
private Geometry readGeoJSON(java.lang.String str) throws ParseException
- Throws:
ParseException
-
readGML
private Geometry readGML(java.lang.String str) throws ParseException
- Throws:
ParseException
-
-