-
public class GeoJsonParserParses a JSONObject and places data into their appropriate GeoJsonFeature objects. Returns an array of GeoJsonFeature objects parsed from the GeoJSON file.
-
-
Constructor Summary
Constructors Constructor Description GeoJsonParser(JSONObject geoJsonFile)Creates a new GeoJsonParser
-
Method Summary
Modifier and Type Method Description static GeometryparseGeometry(JSONObject geoJsonGeometry)Parses a single GeoJSON geometry object containing a coordinates array or a geometries arrayif it has type GeometryCollection. ArrayList<GeoJsonFeature>getFeatures()Gets the array of GeoJsonFeature objects LatLngBoundsgetBoundingBox()Gets the array containing the coordinates of the bounding box for the FeatureCollection. -
-
Constructor Detail
-
GeoJsonParser
GeoJsonParser(JSONObject geoJsonFile)
Creates a new GeoJsonParser- Parameters:
geoJsonFile- GeoJSON file to parse
-
-
Method Detail
-
parseGeometry
static Geometry parseGeometry(JSONObject geoJsonGeometry)
Parses a single GeoJSON geometry object containing a coordinates array or a geometries arrayif it has type GeometryCollection. FeatureCollections, styles, bounding boxes, and propertiesare not processed by this method. If you want to parse GeoJSON including FeatureCollections,styles, bounding boxes, and properties into an array of GeoJsonFeatures theninstantiate GeoJsonParser and call getFeatures.
- Parameters:
geoJsonGeometry- geometry object to parse
-
getFeatures
ArrayList<GeoJsonFeature> getFeatures()
Gets the array of GeoJsonFeature objects
-
getBoundingBox
LatLngBounds getBoundingBox()
Gets the array containing the coordinates of the bounding box for the FeatureCollection. Ifthe FeatureCollection did not have a bounding box or if the GeoJSON file did not contain aFeatureCollection then null will be returned.
-
-
-
-