Package upoints :: Module nmea :: Class Waypoint
[hide private]
[frames] | no frames]

Class Waypoint

 object --+    
          |    
point.Point --+
              |
             Waypoint

Class for representing a NMEA-formatted waypoint

Since: 0.8.0

Instance Methods [hide private]
 
__init__(self, latitude, longitude, name)
Initialise a new Waypoint object
str
__str__(self)
Pretty printed location string

Inherited from point.Point: __dict__, __eq__, __hash__, __ne__, __repr__, __unicode__, bearing, destination, distance, final_bearing, forward, inverse, midpoint, sun_events, sunrise, sunset, to_grid_locator

Inherited from point.Point (private): _set_location

Inherited from object: __delattr__, __getattribute__, __new__, __reduce__, __reduce_ex__, __setattr__

Static Methods [hide private]
Fix
parse_elements(elements)
Parse waypoint data elements
Instance Variables [hide private]
  latitude
Location's latitude
  longitude
Locations's longitude
  name
Waypoint's name

Inherited from point.Point: rad_latitude, rad_longitude, timezone, units

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, latitude, longitude, name)
(Constructor)

 

Initialise a new Waypoint object

>>> Waypoint(52.015, -0.221, "Home")
Waypoint(52.015, -0.221, 'HOME')
Parameters:
  • latitude (float or coercible to float) - Waypoint's latitude
  • longitude (float or coercible to float) - Waypoint's longitude
  • name (str) - Comment for waypoint
Raises:
  • ValueError - Unknown value for angle
  • ValueError - Unknown value for units
  • ValueError - Invalid value for latitude or longitude
Overrides: object.__init__

__str__(self)
(Informal representation operator)

 

Pretty printed location string

>>> print(Waypoint(52.015, -0.221, "Home"))
$GPWPL,5200.9000,N,00013.2600,W,HOME*5E
Parameters:
  • mode - Coordinate formatting system to use
Returns: str
Human readable string representation of Waypoint object
Raises:
  • ValueError - Unknown value for mode
Overrides: object.__str__

parse_elements(elements)
Static Method

 

Parse waypoint data elements

>>> Waypoint.parse_elements(["5200.9000", "N", "00013.2600", "W",
...                          "HOME"])
Waypoint(52.015, -0.221, 'HOME')
Parameters:
  • elements (list) - Data values for fix
Returns: Fix
Fix object representing data