public class FeatureCollection extends GeoJSONObject
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>| Modifier and Type | Field and Description |
|---|---|
static Parcelable.Creator<FeatureCollection> |
CREATOR |
static String |
JSON_FEATURES |
JSON_TYPECONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE| Constructor and Description |
|---|
FeatureCollection()
Creates an empty feature collection.
|
FeatureCollection(JSONObject json)
Parses the given
JSONObject as a feature collection. |
| Modifier and Type | Method and Description |
|---|---|
void |
addFeature(Feature feature)
Adds a
Feature to this feature collection. |
List<Feature> |
getFeatures()
Returns a list of all the
Features contained within this
collection. |
String |
getType()
The type of GeoJSON object.
|
void |
removeFeature(Feature feature)
Removes a given
Feature from this feature collection. |
void |
setFeatures(List<Feature> features)
Sets the list of features contained within this feature collection.
|
JSONObject |
toJSON()
Formats the object's attributes as GeoJSON.
|
describeContents, readParcel, writeToParcelpublic static final String JSON_FEATURES
public static final Parcelable.Creator<FeatureCollection> CREATOR
public FeatureCollection()
public FeatureCollection(JSONObject json)
JSONObject as a feature collection.json - public void addFeature(Feature feature)
Feature to this feature collection.feature - public void removeFeature(Feature feature)
Feature from this feature collection.feature - public List<Feature> getFeatures()
Features contained within this
collection.Features in this collectionpublic void setFeatures(List<Feature> features)
features - public String getType()
GeoJSON, such as GeoJSON.TYPE_FEATURE.getType in class GeoJSONObjectpublic JSONObject toJSON() throws JSONException
toJSON in class GeoJSONObjectJSONObjectJSONException