LocationIfc

Properties

Link copied to clipboard
Link copied to clipboard
open val x: Double

The Cartesian x-coordinate of this location, used by the animation system and any coordinate-based rendering. Defaults to Double.NaN for non-Cartesian spatial models (distance-, network-, or great-circle-based) that have no planar coordinate; Cartesian location types (e.g. Euclidean2DPlane.Point) override it.

Link copied to clipboard
open val y: Double

The Cartesian y-coordinate of this location; see x. Defaults to Double.NaN.

Link copied to clipboard
open val z: Double

The Cartesian z-coordinate of this location; defaults to 0.0 (2D). Three- dimensional spatial models override it. See x.

Functions

Link copied to clipboard
open fun distanceTo(location: LocationIfc): Double

Computes the distance between the current location and location based on the spatial model's distance metric

Link copied to clipboard

Returns true if location is the same as this location within the underlying spatial model. This is not object reference equality, but rather whether the locations within the underlying spatial model can be considered spatially (equivalent) according to the model.

Link copied to clipboard

Extract 2D Cartesian coordinates from any LocationIfc that has them. Returns null for locations whose underlying spatial model does not have a 2D Cartesian representation (DistancesModel.Location — just a name; GreatCircleBasedSpatialModel.GPSCoordinate — spherical geometry, not directly Cartesian).