Package com.cercalia.sdk.model.common
Class Coordinate
java.lang.Object
com.cercalia.sdk.model.common.Coordinate
Represents a geographic coordinate with latitude and longitude.
This is the fundamental spatial data type used throughout the SDK. Coordinates are typically represented in WGS84 (EPSG:4326).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic @NotNull CoordinatefromCercaliaString(@NotNull String coordString) Parses a coordinate from Cercalia format string "lng,lat".doublegetLat()Returns the latitude.doublegetLng()Returns the longitude.inthashCode()@NotNull StringReturns the coordinate as a string in "lng,lat" format (Cercalia format).@NotNull StringReturns the coordinate as a string in "lat,lng" format.toString()
-
Constructor Details
-
Coordinate
public Coordinate(double lat, double lng) Creates a new Coordinate.- Parameters:
lat- the latitudelng- the longitude
-
-
Method Details
-
getLat
public double getLat()Returns the latitude.- Returns:
- the latitude
-
getLng
public double getLng()Returns the longitude.- Returns:
- the longitude
-
toCercaliaString
Returns the coordinate as a string in "lng,lat" format (Cercalia format).- Returns:
- the coordinate string
-
toLatLngString
Returns the coordinate as a string in "lat,lng" format.- Returns:
- the coordinate string
-
fromCercaliaString
Parses a coordinate from Cercalia format string "lng,lat".- Parameters:
coordString- the coordinate string- Returns:
- the parsed Coordinate
- Throws:
IllegalArgumentException- if the string is invalid
-
equals
-
hashCode
public int hashCode() -
toString
-