Package com.azure.core.models
Class GeoLineString
java.lang.Object
com.azure.core.models.GeoObject
com.azure.core.models.GeoLineString
- All Implemented Interfaces:
com.azure.json.JsonSerializable<GeoObject>
Represents a geometric line string.
This class encapsulates a list of GeoPosition instances that form a line string. A line string is a
curve with linear interpolation between points.
This class is useful when you want to work with a line string in a geographic context. For example, you can use it to represent a route on a map or the shape of a geographic feature.
Note: A line string requires at least 2 coordinates.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGeoLineString(List<GeoPosition> positions) Constructs a geometric line.GeoLineString(List<GeoPosition> positions, GeoBoundingBox boundingBox, Map<String, Object> customProperties) Constructs a geometric line. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic GeoLineStringfromJson(com.azure.json.JsonReader jsonReader) Reads a JSON stream into aGeoLineString.Unmodifiable representation of thegeometric positionsrepresenting this line.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
-
GeoLineString
Constructs a geometric line.- Parameters:
positions- Geometric positions that define the line.- Throws:
NullPointerException- Ifpositionsisnull.
-
GeoLineString
public GeoLineString(List<GeoPosition> positions, GeoBoundingBox boundingBox, Map<String, Object> customProperties) Constructs a geometric line.- Parameters:
positions- Geometric positions that define the line.boundingBox- Bounding box for the line.customProperties- Additional properties of the geometric line.- Throws:
NullPointerException- Ifpositionsisnull.
-
-
Method Details
-
getCoordinates
Unmodifiable representation of thegeometric positionsrepresenting this line.- Returns:
- An unmodifiable representation of the
geometric positionsrepresenting this line.
-
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 aGeoLineString.- Parameters:
jsonReader- TheJsonReaderbeing read.- Returns:
- The
GeoLineStringthat the JSON stream represented, or null if it pointed to JSON null. - Throws:
IllegalStateException- If thetypenode exists and isn't equal toLineString.IOException- If aGeoLineStringfails to be read from thejsonReader.
-