GeoJsonFeature Class
- java.
lang. Object - com.
azure. maps. search. models. GeoJsonObject - com.
azure. maps. search. models. GeoJsonFeature
- com.
- com.
public class GeoJsonFeature
extends GeoJsonObject
A valid `GeoJSON Feature` object type. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946\#section-3.2) for details.
Constructor Summary
| Constructor | Description |
|---|---|
| GeoJsonFeature() |
Creates an instance of Geo |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
static
Geo |
fromJson(JsonReader jsonReader)
Reads an instance of Geo |
| String |
getFeatureType()
Get the feature |
|
Geo |
getGeometry()
Get the geometry property: A valid `GeoJSON` geometry object. |
| String |
getId()
Get the id property: Identifier for the feature. |
| Object |
getProperties()
Get the properties property: Properties can contain any additional metadata about the `Feature`. |
|
Geo |
getType()
Get the type property: Specifies the `GeoJSON` type. |
|
Geo |
setBbox(List<Double> bbox)
Set the bbox property: Bounding box. |
|
Geo |
setFeatureType(String featureType)
Set the feature |
|
Geo |
setGeometry(GeoJsonGeometry geometry)
Set the geometry property: A valid `GeoJSON` geometry object. |
|
Geo |
setId(String id)
Set the id property: Identifier for the feature. |
|
Geo |
setProperties(Object properties)
Set the properties property: Properties can contain any additional metadata about the `Feature`. |
|
Json |
toJson(JsonWriter jsonWriter) |
Methods inherited from GeoJsonObject
Methods inherited from java.lang.Object
Constructor Details
GeoJsonFeature
public GeoJsonFeature()
Creates an instance of GeoJsonFeature class.
Method Details
fromJson
public static GeoJsonFeature fromJson(JsonReader jsonReader)
Reads an instance of GeoJsonFeature from the JsonReader.
Parameters:
Returns:
Throws:
getFeatureType
public String getFeatureType()
Get the featureType property: The type of the feature. The value depends on the data model the current feature is part of. Some data models may have an empty value.
Returns:
getGeometry
public GeoJsonGeometry getGeometry()
Get the geometry property: A valid `GeoJSON` geometry object. The type must be one of the seven valid GeoJSON geometry types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon and GeometryCollection. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946\#section-3.1) for details.
Returns:
getId
public String getId()
Get the id property: Identifier for the feature.
Returns:
getProperties
public Object getProperties()
Get the properties property: Properties can contain any additional metadata about the `Feature`. Value can be any JSON object or a JSON null value.
Returns:
getType
public GeoJsonObjectType getType()
Get the type property: Specifies the `GeoJSON` type. Must be one of the nine valid GeoJSON object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, GeometryCollection, Feature and FeatureCollection.
Overrides:
GeoJsonFeature.getType()Returns:
setBbox
public GeoJsonFeature setBbox(List<Double> bbox)
Set the bbox property: Bounding box. Projection used - EPSG:3857. Please refer to [RFC 7946](https://datatracker.ietf.org/doc/html/rfc7946\#section-5) for details.
Overrides:
GeoJsonFeature.setBbox(List<Double> bbox)Parameters:
setFeatureType
public GeoJsonFeature setFeatureType(String featureType)
Set the featureType property: The type of the feature. The value depends on the data model the current feature is part of. Some data models may have an empty value.
Parameters:
Returns:
setGeometry
public GeoJsonFeature setGeometry(GeoJsonGeometry geometry)
Set the geometry property: A valid `GeoJSON` geometry object. The type must be one of the seven valid GeoJSON geometry types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon and GeometryCollection. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946\#section-3.1) for details.
Parameters:
Returns:
setId
public GeoJsonFeature setId(String id)
Set the id property: Identifier for the feature.
Parameters:
Returns:
setProperties
public GeoJsonFeature setProperties(Object properties)
Set the properties property: Properties can contain any additional metadata about the `Feature`. Value can be any JSON object or a JSON null value.
Parameters:
Returns:
toJson
public JsonWriter toJson(JsonWriter jsonWriter)
Overrides:
GeoJsonFeature.toJson(JsonWriter jsonWriter)Parameters:
Throws: