Geolocation structures#
Simple structures to store georeferenced locations and attitudes. Geolocation which records lat/lon can be implicitly converted to and from GeolocationUTM which stores utm coordinates.
Example usage#
# import this module# import this module
from themachinethatgoesping.navigation.datastructures import GeolocationLatLon, GeolocationUTM
location = GeolocationUTM(
5427745.995, # northing
314082.699, # easting
60, #utm zone
False, #northern_hemisphere
3, #depth
10, #yaw
20, #pitch
30) #roll
print(location)
# GeolocationUTM
# **************
# - northing: 5427746.00 [positive northwards, m]
# - easting: 314082.70 [positive eastwards, m]
# - zone: 60
# - northern_hemisphere: false
# - z: 3.00 [positive downwards, m]
# - yaw: 10.00 [90 ° at east]
# - pitch: 20.00 [° positive bow up]
# - roll: 30.00 [° positive port up]
# conversion to latlon location (works in both directions)
location_latlon = Geolocation(location)
print(location_latlon)
# Geolocation
# ***********
# latitude: 41°16'49.2"S [ddd°mm',ss.s''N/S]
# - longitude: 41°16'49.2"W [ddd°mm',ss.s''E/W]
# - z: 3.00 [positive downwards, m]
# - yaw: 10.00 [90 ° at east]
# - pitch: 20.00 [° positive bow up]
# - roll: 30.00 [° positive port up]
Data structures#
A structure to store a georeferenced location and attitude (e.g. of a sensor) Unlike the base Geolocation object, this also stores latitude and longitude coordinates
Overloaded function.
__init__(self: themachinethatgoesping.navigation.datastructures.GeolocationLatLon, location: themachinethatgoesping.navigation.datastructures.Geolocation, latitude: float, longitude: float) -> None
Construct a new Sensor Data Lat Lon object using a base sensor data object
- Parameter
location
: $Parameter
latitude
:
in °, positive northwards
- Parameter
longitude
: in °, positive eastwards
__init__(self: themachinethatgoesping.navigation.datastructures.GeolocationLatLon, geolocationlatlon_utm: themachinethatgoesping::navigation::datastructures::GeolocationUTM) -> None
Construct an GeolocationLatLon object from an existing GeolocationUTM object (this allows for explicit conversion from GeolocationUTM class)
__init__(self: themachinethatgoesping.navigation.datastructures.GeolocationLatLon, latitude: float = 0, longitude: float = 0, z: float = 0, yaw: float = 0, pitch: float = 0, roll: float = 0) -> None
Construct a new GeolocationLatLon object
- Parameter
latitude
: in °, positive northwards
- Parameter
longitude
: in °, positive eastwards
- Parameter
z
: in m, positive downwards
- Parameter
yaw
: in °, 0° is north, 90° is east
- Parameter
pitch
: in °, positive means bow up
- Parameter
roll
: in °, positive means port up
return a copy using the c++ default copy constructor
create T_CLASS object from bytearray
hash function implemented using binary_hash
Return object information as string
< in °, positive northwards
< in °, positive eastwards
Print object information
hash function implemented using slow_hash
convert object to bytearray
A structure to store a georeferenced location and attitude (e.g. of a sensor) unlike the default Geolocation structure, this object stores utm coordinates
Overloaded function.
__init__(self: themachinethatgoesping.navigation.datastructures.GeolocationUTM, geolocationlocal: themachinethatgoesping.navigation.datastructures.GeolocationLocal, utm_zone: int, northern_hemisphere: bool) -> None
Construct an GeolocationUTM object from an existing GeolocationLocal object (using a known zone and hemisphere)
- Parameter
location_local
: $Parameter
utm_zone
:
UTM/UPS zone number
- Parameter
northern_hemisphere
: if true: northern hemisphere, else: southern hemisphere
__init__(self: themachinethatgoesping.navigation.datastructures.GeolocationUTM, geolocationlatlon: themachinethatgoesping.navigation.datastructures.GeolocationLatLon, setzone: int = -1) -> None
Construct an GeolocationUTM object from an existing GeolocationLatLon object (this allows for explicit conversion from GeolocationLatLon class)
__init__(self: themachinethatgoesping.navigation.datastructures.GeolocationUTM, northing: float = 0, easting: float = 0, utm_zone: int = 0, northern_hemisphere: bool = True, z: float = 0, yaw: float = 0, pitch: float = 0, roll: float = 0) -> None
Construct a new GeolocationUTM object
- Parameter
northing
: in m, positive northwards
- Parameter
easting
: in m, positive eastwards
- Parameter
utm_zone
: UTM/UPS zone number
- Parameter
northern_hemisphere
: if true: northern hemisphere, else: southern hemisphere
- Parameter
z
: in m, positive downwards
- Parameter
yaw
: in °, 0° is north, 90° is east
- Parameter
pitch
: in °, positive means bow up
- Parameter
roll
: in °, positive means port up
return a copy using the c++ default copy constructor
create T_CLASS object from bytearray
hash function implemented using binary_hash
Return object information as string
Print object information
hash function implemented using slow_hash
convert object to bytearray
< UTM/UPS zone number
A structure to store a georeferenced location and attitude (e.g. of a sensor) unlike the default Geolocation structure, this object stores local northing and easting coordinates. These coordinates can be converted to UTM coordinates if the zone and hemisphere are known.
Overloaded function.
__init__(self: themachinethatgoesping.navigation.datastructures.GeolocationLocal, geolocationutm: themachinethatgoesping::navigation::datastructures::GeolocationUTM) -> None
Construct a new Sensor Position object (all offsets set to 0)
__init__(self: themachinethatgoesping.navigation.datastructures.GeolocationLocal, geolocation: themachinethatgoesping.navigation.datastructures.Geolocation, northing: float, easting: float) -> None
Construct a new GeolocationLocal object
- Parameter
location
: $Parameter
northing
:
in m, positive northwards
- Parameter
easting
: in m, positive eastwards
__init__(self: themachinethatgoesping.navigation.datastructures.GeolocationLocal, northing: float = 0, easting: float = 0, z: float = 0, yaw: float = 0, pitch: float = 0, roll: float = 0) -> None
Construct a new GeolocationLocal object
- Parameter
northing
: in m, positive northwards
- Parameter
easting
: in m, positive eastwards
- Parameter
z
: in m, positive downwards
- Parameter
yaw
: in °, 0° is north, 90° is east
- Parameter
pitch
: in °, positive means bow up
- Parameter
roll
: in °, positive means port up
return a copy using the c++ default copy constructor
< in m, positive eastwards
create T_CLASS object from bytearray
hash function implemented using binary_hash
Return object information as string
< in m, positive northwards
Print object information
hash function implemented using slow_hash
convert object to bytearray
A structure to store a georeferenced location and attitude (e.g. of a sensor) This structure does not store any coordinates except the depth (z)
Overloaded function.
__init__(self: themachinethatgoesping.navigation.datastructures.Geolocation, geolocation_latlon: themachinethatgoesping::navigation::datastructures::GeolocationLatLon) -> None
Construct a new Position object
__init__(self: themachinethatgoesping.navigation.datastructures.Geolocation, geolocation_local: themachinethatgoesping::navigation::datastructures::GeolocationLocal) -> None
Construct a new Position object
__init__(self: themachinethatgoesping.navigation.datastructures.Geolocation, geolocation_utm: themachinethatgoesping::navigation::datastructures::GeolocationUTM) -> None
Construct a new Position object
__init__(self: themachinethatgoesping.navigation.datastructures.Geolocation, z: float = 0, yaw: float = 0, pitch: float = 0, roll: float = 0) -> None
Construct a new Geolocation object
- Parameter
z
: in m, positive downwards
- Parameter
yaw
: in °, 0° is north, 90° is east
- Parameter
pitch
: in °, positive means bow up
- Parameter
roll
: in °, positive means port up
return a copy using the c++ default copy constructor
create T_CLASS object from bytearray
hash function implemented using binary_hash
Return object information as string
< in °, positive means bow up
Print object information
< in °, positive means port up
hash function implemented using slow_hash
convert object to bytearray
< in °, 0° is north, 90° is east
< in m, positive downwards