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

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__(*args, **kwargs)

Overloaded function.

  1. __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

  1. __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 implicit conversion from GeoLocationUTM class)

  1. __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

copy(self: GeoLocationLatLon) GeoLocationLatLon

return a copy using the c++ default copy constructor

static from_binary(buffer: bytes, check_buffer_is_read_completely: bool = True) GeoLocationLatLon

create T_CLASS object from bytearray

info_string(self: GeoLocationLatLon, float_precision: int = 2) str

Return object information as string

property latitude

< in °, positive northwards

property longitude

< in °, positive eastwards

print(self: GeoLocationLatLon, float_precision: int = 2) None

Print object information

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

convert object to bytearray

class GeoLocationUTM
__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: themachinethatgoesping.navigation.datastructures.GeoLocationUTM, geolocationlatlon: themachinethatgoesping.navigation.datastructures.GeoLocationLocal, 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 zone:

UTM/UPS zone number

Parameter northern_hemisphere:

if true: northern hemisphere, else: southern hemisphere

  1. __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 implicit conversion from GeoLocationLatLon class)

  1. __init__(self: themachinethatgoesping.navigation.datastructures.GeoLocationUTM, northing: float = 0, easting: float = 0, 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 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

copy(self: GeoLocationUTM) GeoLocationUTM

return a copy using the c++ default copy constructor

static from_binary(buffer: bytes, check_buffer_is_read_completely: bool = True) GeoLocationUTM

create T_CLASS object from bytearray

info_string(self: GeoLocationUTM, float_precision: int = 2) str

Return object information as string

property northern_hemisphere

southern hemisphere

Type

< if true

Type

northern hemisphere, else

print(self: GeoLocationUTM, float_precision: int = 2) None

Print object information

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

convert object to bytearray

property zone

< UTM/UPS zone number

class GeoLocationLocal

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__(*args, **kwargs)

Overloaded function.

  1. __init__(self: themachinethatgoesping.navigation.datastructures.GeoLocationLocal, geolocationutm: themachinethatgoesping::navigation::datastructures::GeoLocationUTM) -> None

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

  1. __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

  1. __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

copy(self: GeoLocationLocal) GeoLocationLocal

return a copy using the c++ default copy constructor

property easting

< in m, positive eastwards

static from_binary(buffer: bytes, check_buffer_is_read_completely: bool = True) GeoLocationLocal

create T_CLASS object from bytearray

info_string(self: GeoLocationLocal, float_precision: int = 2) str

Return object information as string

property northing

< in m, positive northwards

print(self: GeoLocationLocal, float_precision: int = 2) None

Print object information

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

convert object to bytearray

class GeoLocation

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__(*args, **kwargs)

Overloaded function.

  1. __init__(self: themachinethatgoesping.navigation.datastructures.GeoLocation, geolocation_latlon: themachinethatgoesping::navigation::datastructures::GeoLocationLatLon) -> None

Construct a new Position object

  1. __init__(self: themachinethatgoesping.navigation.datastructures.GeoLocation, geolocation_local: themachinethatgoesping::navigation::datastructures::GeoLocationLocal) -> None

Construct a new Position object

  1. __init__(self: themachinethatgoesping.navigation.datastructures.GeoLocation, geolocation_utm: themachinethatgoesping::navigation::datastructures::GeoLocationUTM) -> None

Construct a new Position object

  1. __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

copy(self: GeoLocation) GeoLocation

return a copy using the c++ default copy constructor

static from_binary(buffer: bytes, check_buffer_is_read_completely: bool = True) GeoLocation

create T_CLASS object from bytearray

info_string(self: GeoLocation, float_precision: int = 2) str

Return object information as string

property pitch

< in °, positive means bow up

print(self: GeoLocation, float_precision: int = 2) None

Print object information

property roll

< in °, positive means port up

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

convert object to bytearray

property yaw

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

property z

< in m, positive downwards