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#

https://mybinder.org/badge_logo.svg
 # 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#

class GeolocationLatLon(*args, **kwargs)#

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

__init__(self, location: Geolocation, latitude: float, longitude: float) None#
__init__(self, geolocationlatlon_utm: GeolocationUTM) None
__init__(self, latitude: float = 0, longitude: float = 0, z: float = 0.0, yaw: float = 0.0, pitch: float = 0.0, roll: float = 0.0) None

Overloaded function.

  1. __init__(self, location: themachinethatgoesping.navigation_nanopy.datastructures.Geolocation, latitude: float, longitude: float) -> None

Construct a new Sensor Data Lat Lon object using a base sensor data object

Parameters:
  • location

  • latitude – in °, positive northwards

  • longitude – in °, positive eastwards

  1. __init__(self, geolocationlatlon_utm: themachinethatgoesping.navigation_nanopy.datastructures.GeolocationUTM) -> None

Construct an GeolocationLatLon object from an existing GeolocationUTM object (this allows for explicit conversion from GeolocationUTM class)

  1. __init__(self, latitude: float = 0, longitude: float = 0, z: float = 0.0, yaw: float = 0.0, pitch: float = 0.0, roll: float = 0.0) -> None

Construct a new GeolocationLatLon object

Parameters:
  • latitude – in °, positive northwards

  • longitude – in °, positive eastwards

  • z – in m, positive downwards

  • yaw – in °, 0° is north, 90° is east

  • pitch – in °, positive means bow up

  • roll – in °, positive means port up

copy(self) GeolocationLatLon#

return a copy using the c++ default copy constructor

from_binary = <nanobind.nb_func object>#
hash(self) int#

hash function implemented using binary_hash

info_string(self, float_precision: int = 3, superscript_exponents: bool = True) str#

Return object information as string

property latitude#

in °, positive northwards

property longitude#

in °, positive eastwards

print(self, float_precision: int = 3, superscript_exponents: bool = True) None#

Print object information

to_binary(self, resize_buffer: bool = True) bytes#

convert object to bytearray

class GeolocationUTM(*args, **kwargs)#

A structure to store a georeferenced location and attitude (e.g. of a sensor) unlike the default Geolocation structure, this object stores utm coordinates

__init__(self, geolocationlocal: GeolocationLocal, utm_zone: int, northern_hemisphere: bool) None#
__init__(self, geolocationlatlon: GeolocationLatLon, setzone: int = -1) None
__init__(self, northing: float = 0, easting: float = 0, utm_zone: int = 0, northern_hemisphere: bool = True, z: float = 0.0, yaw: float = 0.0, pitch: float = 0.0, roll: float = 0.0) None

Overloaded function.

  1. __init__(self, geolocationlocal: themachinethatgoesping.navigation_nanopy.datastructures.GeolocationLocal, utm_zone: int, northern_hemisphere: bool) -> None

Construct an GeolocationUTM object from an existing GeolocationLocal object (using a known zone and hemisphere)

Parameters:
  • location_local

  • utm_zone – UTM/UPS zone number

  • northern_hemisphere – if true: northern hemisphere, else: southern hemisphere

  1. __init__(self, geolocationlatlon: themachinethatgoesping.navigation_nanopy.datastructures.GeolocationLatLon, setzone: int = -1) -> None

Construct an GeolocationUTM object from an existing GeolocationLatLon object (this allows for explicit conversion from GeolocationLatLon class)

  1. __init__(self, northing: float = 0, easting: float = 0, utm_zone: int = 0, northern_hemisphere: bool = True, z: float = 0.0, yaw: float = 0.0, pitch: float = 0.0, roll: float = 0.0) -> None

Construct a new GeolocationUTM object

Parameters:
  • northing – in m, positive northwards

  • easting – in m, positive eastwards

  • utm_zone – UTM/UPS zone number

  • northern_hemisphere – if true: northern hemisphere, else: southern hemisphere

  • z – in m, positive downwards

  • yaw – in °, 0° is north, 90° is east

  • pitch – in °, positive means bow up

  • roll – in °, positive means port up

copy(self) GeolocationUTM#

return a copy using the c++ default copy constructor

from_binary = <nanobind.nb_func object>#
hash(self) int#

hash function implemented using binary_hash

info_string(self, float_precision: int = 3, superscript_exponents: bool = True) str#

Return object information as string

property northern_hemisphere#

(self) -> bool

print(self, float_precision: int = 3, superscript_exponents: bool = True) None#

Print object information

to_binary(self, resize_buffer: bool = True) bytes#

convert object to bytearray

property utm_zone#

UTM/UPS zone number

class GeolocationLocal(*args, **kwargs)#

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.

__init__(self, geolocationutm: GeolocationUTM) None#
__init__(self, geolocation: Geolocation, northing: float, easting: float) None
__init__(self, northing: float = 0.0, easting: float = 0.0, z: float = 0.0, yaw: float = 0.0, pitch: float = 0.0, roll: float = 0.0) None

Overloaded function.

  1. __init__(self, geolocationutm: themachinethatgoesping.navigation_nanopy.datastructures.GeolocationUTM) -> None

Construct a new Sensor Position object (all offsets set to 0)

  1. __init__(self, geolocation: themachinethatgoesping.navigation_nanopy.datastructures.Geolocation, northing: float, easting: float) -> None

Construct a new GeolocationLocal object

Parameters:
  • location

  • northing – in m, positive northwards

  • easting – in m, positive eastwards

  1. __init__(self, northing: float = 0.0, easting: float = 0.0, z: float = 0.0, yaw: float = 0.0, pitch: float = 0.0, roll: float = 0.0) -> None

Construct a new GeolocationLocal object

Parameters:
  • northing – in m, positive northwards

  • easting – in m, positive eastwards

  • z – in m, positive downwards

  • yaw – in °, 0° is north, 90° is east

  • pitch – in °, positive means bow up

  • roll – in °, positive means port up

copy(self) GeolocationLocal#

return a copy using the c++ default copy constructor

property easting#

in m, positive eastwards

from_binary = <nanobind.nb_func object>#
hash(self) int#

hash function implemented using binary_hash

info_string(self, float_precision: int = 3, superscript_exponents: bool = True) str#

Return object information as string

property northing#

in m, positive northwards

print(self, float_precision: int = 3, superscript_exponents: bool = True) None#

Print object information

to_binary(self, resize_buffer: bool = True) bytes#

convert object to bytearray

class Geolocation(*args, **kwargs)#

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)

__init__(self, geolocation_latlon: GeolocationLatLon) None#
__init__(self, geolocation_local: GeolocationLocal) None
__init__(self, geolocation_utm: GeolocationUTM) None
__init__(self, z: float = 0, yaw: float = 0, pitch: float = 0, roll: float = 0) None

Overloaded function.

  1. __init__(self, geolocation_latlon: themachinethatgoesping.navigation_nanopy.datastructures.GeolocationLatLon) -> None

Construct a new Position object

  1. __init__(self, geolocation_local: themachinethatgoesping.navigation_nanopy.datastructures.GeolocationLocal) -> None

Construct a new Position object

  1. __init__(self, geolocation_utm: themachinethatgoesping.navigation_nanopy.datastructures.GeolocationUTM) -> None

Construct a new Position object

  1. __init__(self, z: float = 0, yaw: float = 0, pitch: float = 0, roll: float = 0) -> None

Construct a new Geolocation object

Parameters:
  • z – in m, positive downwards

  • yaw – in °, 0° is north, 90° is east

  • pitch – in °, positive means bow up

  • roll – in °, positive means port up

copy(self) Geolocation#

return a copy using the c++ default copy constructor

from_binary = <nanobind.nb_func object>#
hash(self) int#

hash function implemented using binary_hash

info_string(self, float_precision: int = 3, superscript_exponents: bool = True) str#

Return object information as string

property pitch#

in °, positive means bow up

print(self, float_precision: int = 3, superscript_exponents: bool = True) None#

Print object information

property roll#

in °, positive means port up

to_binary(self, resize_buffer: bool = True) bytes#

convert object to bytearray

property yaw#

in °, 0° is north, 90° is east

property z#

in m, positive downwards