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

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 Details

    • GeoJsonFeature

      public GeoJsonFeature()
      Creates an instance of GeoJsonFeature class.
  • Method Details

    • 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:
      getType in class GeoJsonObject
      Returns:
      the type value.
    • 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:
      the geometry value.
    • 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:
      geometry - the geometry value to set.
      Returns:
      the GeoJsonFeature object itself.
    • 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:
      the properties value.
    • 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:
      properties - the properties value to set.
      Returns:
      the GeoJsonFeature object itself.
    • getId

      public String getId()
      Get the id property: Identifier for the feature.
      Returns:
      the id value.
    • setId

      public GeoJsonFeature setId(String id)
      Set the id property: Identifier for the feature.
      Parameters:
      id - the id value to set.
      Returns:
      the GeoJsonFeature object itself.
    • 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:
      the featureType value.
    • 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:
      featureType - the featureType value to set.
      Returns:
      the GeoJsonFeature object itself.
    • 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:
      setBbox in class GeoJsonObject
      Parameters:
      bbox - the bbox value to set.
      Returns:
      the GeoJsonObject object itself.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<GeoJsonObject>
      Overrides:
      toJson in class GeoJsonObject
      Throws:
      IOException
    • fromJson

      public static GeoJsonFeature fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      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.