public class Feature extends GeoJSONObject
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>| Modifier and Type | Field and Description |
|---|---|
static Parcelable.Creator<Feature> |
CREATOR |
JSON_TYPECONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE| Constructor and Description |
|---|
Feature()
Creates an empty Feature without a geometry.
|
Feature(Geometry geometry)
Creates a new GeoJSON Feature object with the given geometry.
|
Feature(JSONObject json)
Parses the given
JSONObject as a GeoJSON Feature. |
| Modifier and Type | Method and Description |
|---|---|
Geometry |
getGeometry()
Returns the geometry of this feature.
|
String |
getIdentifier()
The optional, common identifier of this feature.
|
JSONObject |
getProperties()
Returns the optional properties of this feature as JSON.
|
String |
getType()
The type of GeoJSON object.
|
void |
setGeometry(Geometry geometry)
Sets the
Geometry of this feature. |
void |
setIdentifier(String identifier)
Sets the optional, common identifier of this feature.
|
void |
setProperties(JSONObject properties)
Sets the properties of this feature.
|
JSONObject |
toJSON()
Formats the object's attributes as GeoJSON.
|
describeContents, readParcel, writeToParcelpublic static final Parcelable.Creator<Feature> CREATOR
public Feature()
public Feature(JSONObject json)
JSONObject as a GeoJSON Feature.json - public Feature(Geometry geometry)
geometry - public String getIdentifier()
public void setIdentifier(String identifier)
identifier - public Geometry getGeometry()
Geometry.public void setGeometry(Geometry geometry)
Geometry of this feature.geometry - public JSONObject getProperties()
public void setProperties(JSONObject properties)
properties - public String getType()
GeoJSON, such as GeoJSON.TYPE_FEATURE.getType in class GeoJSONObjectpublic JSONObject toJSON() throws JSONException
toJSON in class GeoJSONObjectJSONObjectJSONException