Package com.azure.core.models
Class GeoPointCollection
java.lang.Object
com.azure.core.models.GeoObject
com.azure.core.models.GeoPointCollection
- All Implemented Interfaces:
com.azure.json.JsonSerializable<GeoObject>
Represents a collection of GeoPoints in GeoJSON format.
This class encapsulates a list of GeoPoint instances that form a collection of points. Each point is
defined by a GeoPosition which includes the longitude, latitude, and optionally the altitude.
This class also provides a toJson(JsonWriter) method to serialize the collection of points to JSON,
and a fromJson(JsonReader) method to deserialize a collection of points from JSON.
Note:A point collection requires at least 2 coordinates for each point.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGeoPointCollection(List<GeoPoint> points) Constructs aGeoPointCollection.GeoPointCollection(List<GeoPoint> points, GeoBoundingBox boundingBox, Map<String, Object> customProperties) Constructs aGeoPointCollection. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic GeoPointCollectionfromJson(com.azure.json.JsonReader jsonReader) Reads a JSON stream into aGeoPointCollection.Unmodifiable representation of thegeometric pointsrepresenting this multi-point.getType()Gets the GeoJSON type for this object.inthashCode()com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Methods inherited from class com.azure.core.models.GeoObject
getBoundingBox, getCustomPropertiesMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
GeoPointCollection
Constructs aGeoPointCollection.- Parameters:
points- The points that define the multi-point.- Throws:
NullPointerException- Ifpointsisnull.
-
GeoPointCollection
public GeoPointCollection(List<GeoPoint> points, GeoBoundingBox boundingBox, Map<String, Object> customProperties) Constructs aGeoPointCollection.- Parameters:
points- The points that define the multi-point.boundingBox- Bounding box for the multi-point.customProperties- Additional properties of the multi-point.- Throws:
NullPointerException- Ifpointsisnull.
-
-
Method Details
-
getPoints
Unmodifiable representation of thegeometric pointsrepresenting this multi-point.- Returns:
- An unmodifiable representation of the
geometric pointsrepresenting this multi-point.
-
getType
Description copied from class:GeoObjectGets the GeoJSON type for this object. -
hashCode
public int hashCode() -
equals
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<GeoObject>- Overrides:
toJsonin classGeoObject- Throws:
IOException
-
fromJson
Reads a JSON stream into aGeoPointCollection.- Parameters:
jsonReader- TheJsonReaderbeing read.- Returns:
- The
GeoPointCollectionthat the JSON stream represented, or null if it pointed to JSON null. - Throws:
IllegalStateException- If thetypenode exists and isn't equal toMultiPoint.IOException- If aGeoPointCollectionfails to be read from thejsonReader.
-