Skip to content

Location

Part of Locations in the Python API reference.

Related guidance: concepts/locations, how-to/observe-location, how-to/pli-entities.

Runnable examples: publish_location.py, get_ecn_location.py.

from picogrid_ecn_client import Location

Represent timestamped WGS-84 Position Location Information.

Location(
*,
latitude: float,
longitude: float,
recorded_at: datetime,
altitude: float | None = None,
bearing: float | None = None,
accuracy: float | None = None,
source: str | None = None,
velocity: Velocity | None = None,
angular_velocity: AngularVelocity | None = None,
confidence: float | None = None,
)

Source · models/location.py

NameTypeRequiredDefaultConstraintsDescription
latitudefloatyesge=-90, le=90, finiteFinite WGS-84 latitude in decimal degrees, from -90 through 90.
longitudefloatyesge=-180, le=180, finiteFinite WGS-84 longitude in decimal degrees, from -180 through 180.
recorded_atdatetimeyesTimezone-aware time when the location was recorded.
altitudefloat | NonenoNonefiniteOptional finite altitude in metres.
bearingfloat | NonenoNonege=0, lt=360, finiteOptional finite bearing in degrees, from 0 inclusive to 360 exclusive.
accuracyfloat | NonenoNonege=0, finiteOptional non-negative finite horizontal accuracy in metres.
sourcestr | NonenoNonemin_length=1, max_length=128Optional location source label, from 1 through 128 characters.
velocityVelocity | NonenoNoneOptional north/east/down velocity in metres per second.
angular_velocityAngularVelocity | NonenoNoneOptional roll/pitch/yaw rates in radians per second; axis interpretation is deployed-unverified.
confidencefloat | NonenoNonege=0, le=1, finiteOptional finite confidence fraction, from 0 through 1.

Return the position of this location as a geodetic coordinate triple.

def to_geodetic(*, assume_zero_ellipsoidal_height: bool = False) -> GeodeticPosition
NameTypeDefaultDescription
assume_zero_ellipsoidal_heightboolFalseTreat a missing altitude as zero height above the WGS-84 ellipsoid instead of raising.
TypeDescription
GeodeticPositionThis location’s position as a geodetic coordinate triple.
ExceptionDescription
ValidationErrorIf altitude is missing and the caller did not assume zero ellipsoidal height.

Source · models/location.py

Convert the position of this location to EPSG:4978 Cartesian metres.

def to_ecef(*, assume_zero_ellipsoidal_height: bool = False) -> ECEFPosition
NameTypeDefaultDescription
assume_zero_ellipsoidal_heightboolFalseTreat a missing altitude as zero height above the WGS-84 ellipsoid instead of raising.
TypeDescription
ECEFPositionThis location’s position as an EPSG:4978 Cartesian position.
ExceptionDescription
ValidationErrorIf altitude is missing and the caller did not assume zero ellipsoidal height.

Source · models/location.py

Rotate the velocity of this location onto EPSG:4978 axes.

def to_ecef_velocity() -> ECEFVelocity
TypeDescription
ECEFVelocityThis location’s velocity expressed on EPSG:4978 axes.
ExceptionDescription
ValidationErrorIf the location carries no velocity, with code missing_velocity.

Source · models/location.py

Version 0.2.0 · branch main