Package org.locationtech.jtstest.util.io
Class MultiFormatReader
- java.lang.Object
-
- org.locationtech.jtstest.util.io.MultiFormatReader
-
public class MultiFormatReader extends java.lang.ObjectReads aGeometryfrom a string which is in either WKT, WKBHex or GML format- Version:
- 1.7
-
-
Field Summary
Fields Modifier and Type Field Description private static intFORMAT_GEOJSONstatic intFORMAT_GMLstatic intFORMAT_UNKNOWNstatic intFORMAT_WKBstatic intFORMAT_WKTprivate GeometryFactorygeomFactoryprivate static intMAX_CHARS_TO_CHECKprivate WKBReaderwkbReaderprivate WKTReaderwktReader
-
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 intformat(java.lang.String s)static booleanisGeoJSON(java.lang.String str)static booleanisGML(java.lang.String str)private static booleanisHex(java.lang.String str, int maxCharsToTest)private static booleanisHexDigit(char ch)static booleanisWKB(java.lang.String str)static booleanisWKT(java.lang.String s)Geometryread(java.lang.String geomStr)private GeometryreadGeoJSON(java.lang.String str)private GeometryreadGML(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:
ParseExceptionjava.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
-
-