Package com.azure.maps.search.models
Class GeoJsonFeature
java.lang.Object
com.azure.maps.search.models.GeoJsonObject
com.azure.maps.search.models.GeoJsonFeature
- All Implemented Interfaces:
com.azure.json.JsonSerializable<GeoJsonObject>
- Direct Known Subclasses:
Boundary
A valid `GeoJSON Feature` object type. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.2)
for details.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic GeoJsonFeaturefromJson(com.azure.json.JsonReader jsonReader) Reads an instance of GeoJsonFeature from the JsonReader.Get the featureType property: The type of the feature.Get the geometry property: A valid `GeoJSON` geometry object.getId()Get the id property: Identifier for the feature.Get the properties property: Properties can contain any additional metadata about the `Feature`.getType()Get the type property: Specifies the `GeoJSON` type.Set the bbox property: Bounding box.setFeatureType(String featureType) Set the featureType property: The type of the feature.setGeometry(GeoJsonGeometry geometry) Set the geometry property: A valid `GeoJSON` geometry object.Set the id property: Identifier for the feature.setProperties(Object properties) Set the properties property: Properties can contain any additional metadata about the `Feature`.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Methods inherited from class com.azure.maps.search.models.GeoJsonObject
getBboxMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
GeoJsonFeature
public GeoJsonFeature()Creates an instance of GeoJsonFeature class.
-
-
Method Details
-
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:
getTypein classGeoJsonObject- Returns:
- the type value.
-
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:
- the geometry value.
-
setGeometry
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:
geometry- the geometry value to set.- Returns:
- the GeoJsonFeature object itself.
-
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:
- the properties value.
-
setProperties
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:
properties- the properties value to set.- Returns:
- the GeoJsonFeature object itself.
-
getId
Get the id property: Identifier for the feature.- Returns:
- the id value.
-
setId
Set the id property: Identifier for the feature.- Parameters:
id- the id value to set.- Returns:
- the GeoJsonFeature object itself.
-
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:
- the featureType value.
-
setFeatureType
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:
featureType- the featureType value to set.- Returns:
- the GeoJsonFeature object itself.
-
setBbox
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:
setBboxin classGeoJsonObject- Parameters:
bbox- the bbox value to set.- Returns:
- the GeoJsonObject object itself.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<GeoJsonObject>- Overrides:
toJsonin classGeoJsonObject- Throws:
IOException
-
fromJson
Reads an instance of GeoJsonFeature from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of GeoJsonFeature if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IllegalStateException- If the deserialized JSON object was missing any required properties.IOException- If an error occurs while reading the GeoJsonFeature.
-