Package org.geotools.geojson
Class GeoJSONUtil
- Object
-
- GeoJSONUtil
-
public class GeoJSONUtil extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringDATE_FORMATDate format (ISO 8601)static FastDateFormatdateFormatterstatic TimeZoneTIME_ZONE
-
Constructor Summary
Constructors Constructor Description GeoJSONUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanaddOrdinate(List<Object> ordinates, Object value)static StringBuilderarray(String key, Object value, StringBuilder sb)static CoordinatecreateCoordinate(List ordinates)static Coordinate[]createCoordinates(List<Coordinate> coordinates)static voidencode(String json, Object output)static voidencode(Map<String,Object> obj, Object output)static StringBuilderentry(String key, Object value, StringBuilder sb)static StringBuildernul(StringBuilder sb)static <T> Tparse(IContentHandler<T> handler, Object input, boolean trace)static ObjectreplaceGeometry(Object justAdded)static StringBuilderstring(String string, StringBuilder sb)static ReadertoReader(Object input)Converts an object to aReaderinstance.static WritertoWriter(Object output)Converts an object toWriterinstance.static <T> Ttrace(T handler, Class<T> clazz)
-
-
-
Field Detail
-
DATE_FORMAT
public static final String DATE_FORMAT
Date format (ISO 8601)- See Also:
- Constant Field Values
-
TIME_ZONE
public static final TimeZone TIME_ZONE
-
dateFormatter
public static final FastDateFormat dateFormatter
-
-
Method Detail
-
toReader
public static Reader toReader(Object input) throws IOException
Converts an object to aReaderinstance.The input parameter may be one of the following types:
* A string parameter is considered a file path.- Parameters:
input- The input object.- Returns:
- A reader.
- Throws:
IOException
-
toWriter
public static Writer toWriter(Object output) throws IOException
Converts an object toWriterinstance.The output parameter may be one of the following types:
* A string parameter is considered a file path.- Parameters:
output- The output object.- Returns:
- A writer.
- Throws:
IOException
-
string
public static StringBuilder string(String string, StringBuilder sb)
-
entry
public static StringBuilder entry(String key, Object value, StringBuilder sb)
-
array
public static StringBuilder array(String key, Object value, StringBuilder sb)
-
nul
public static StringBuilder nul(StringBuilder sb)
-
trace
public static <T> T trace(T handler, Class<T> clazz)
-
createCoordinate
public static Coordinate createCoordinate(List ordinates) throws ParseException
- Throws:
ParseException
-
createCoordinates
public static Coordinate[] createCoordinates(List<Coordinate> coordinates)
-
parse
public static <T> T parse(IContentHandler<T> handler, Object input, boolean trace) throws IOException
- Throws:
IOException
-
encode
public static void encode(String json, Object output) throws IOException
- Throws:
IOException
-
encode
public static void encode(Map<String,Object> obj, Object output) throws IOException
- Throws:
IOException
-
replaceGeometry
public static Object replaceGeometry(Object justAdded) throws ParseException, IOException
- Throws:
ParseExceptionIOException
-
-