public class GeoJSONReader extends Object implements AutoCloseable
Modifier and Type | Field and Description |
---|---|
static String |
GEOMETRY_NAME
GEOMETRY_NAME
|
Constructor and Description |
---|
GeoJSONReader(InputStream is)
Builds a GeoJSON parser from a GeoJSON document, provided as an
InputStream |
GeoJSONReader(String json)
Builds a GeoJSON parser from a GeoJSON document, provided as a string
|
GeoJSONReader(URL url)
Builds a GeoJSON parser from a GeoJSON source, located at the specified URL.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
SimpleFeature |
getFeature()
Parses and returns a single feature from the source
|
SimpleFeatureCollection |
getFeatures()
Parses all features in the source and returns them as an in-memory feature collection with a
stable
FeatureType . |
SimpleFeatureIterator |
getIterator()
Returns a
FeatureIterator streaming over the provided source. |
FeatureType |
getSchema()
Returns the current feature type, with the structure discovered so far while parsing features
(parse them all in order to get a final, stable feature type):
|
boolean |
isConnected()
Returns true if the source is still connected, false otherwise.
|
boolean |
isGuessingDates()
Returns true if the parser is trying to convert string formatted as dates into
java.util.Date, false otherwise.
|
boolean |
isSchemaChanged() |
static SimpleFeature |
parseFeature(String json)
Pares and returns a single feature out of a GeoJSON document
|
static SimpleFeatureCollection |
parseFeatureCollection(String jsonString)
Parses and returns a feature collection from a GeoJSON
|
static Geometry |
parseGeometry(String input)
Parses and returns a single geometry
|
void |
setGuessingDates(boolean guessingDates)
Enables/Disables guessing strings formatted as dates into java.util.Date.
|
void |
setSchema(SimpleFeatureType schema) |
void |
setSchemaChanged(boolean schemaChanged) |
public static final String GEOMETRY_NAME
public GeoJSONReader(URL url) throws IOException
url
- IOException
public GeoJSONReader(InputStream is) throws IOException
InputStream
IOException
public GeoJSONReader(String json) throws IOException
IOException
public boolean isGuessingDates()
public void setGuessingDates(boolean guessingDates)
public boolean isConnected()
public static SimpleFeature parseFeature(String json) throws JsonParseException, IOException
JsonParseException
IOException
public static SimpleFeatureCollection parseFeatureCollection(String jsonString)
public static Geometry parseGeometry(String input)
public SimpleFeature getFeature() throws IOException
IOException
public SimpleFeatureCollection getFeatures() throws IOException
FeatureType
. In order to stream use getIterator()
instead.IOException
public SimpleFeatureIterator getIterator() throws IOException
FeatureIterator
streaming over the provided source. The feature type may
evolve feature by feature, discovering new attributes that were not previosly encountered.IOException
public FeatureType getSchema() throws IOException
IOException
public void setSchema(SimpleFeatureType schema)
schema
- the schema to setpublic boolean isSchemaChanged()
public void setSchemaChanged(boolean schemaChanged)
schemaChanged
- the schemaChanged to setpublic void close() throws IOException
close
in interface AutoCloseable
IOException
Copyright © 1996–2022 Geotools. All rights reserved.