upoints.trigpoints.Trigpoint

Package upoints :: Module trigpoints :: Class Trigpoint |
[hide private]
[frames] | no frames]

# Class Trigpoint

     object --+
              |
    point.Point --+
                  |
                 Trigpoint

Known Subclasses:
  - geonames.Location
  - , weather_stations.Station
  - , cities.City
  - , kml.Placemark

Class for representing a location from a trigpoint marker file

Warning: Although this class stores and presents the representation of altitude it doesn't take it in to account when making calculations. For example, consider a point at the base of Mount Everest and a point at the peak of Mount Everest the actual distance travelled between the two would be larger than the reported value calculated at ground level.

Since: 0.2.0

Instance Methods | [hide private]
__init__(self, latitude, longitude, altitude, name=None, identity=None) Initialise a new Trigpoint object |
`str` |
__str__(self, mode=`'``dms``'`) 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__`

Instance Variables | [hide private]
| altitude Location's altitude
| identity Database identifier, if known
| latitude Location's latitude
| longitude Locations's longitude
| name Location's name
Inherited from `point.Point`: `rad_latitude`, `rad_longitude`, `timezone`, `units`

Properties | [hide private]
Inherited from `point.Point` (private): `_angle`, `_latitude`, `_longitude`, `_rad_latitude`, `_rad_longitude` Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, latitude, longitude, altitude, name=None, identity=None) (Constructor) |
Initialise a new Trigpoint object
    >>> Trigpoint(52.010585, -0.173443, 97.0, "Bygrave")
    Trigpoint(52.010585, -0.173443, 97.0, 'Bygrave', None)
Parameters: `latitude` (`float` or coercible to `float`) - Location's latitude `longitude` (`float` or coercible to `float`) - Location's longitude `altitude` (`float` or coercible to `float`) - Location's altitude `name` (`str`) - Name for location `identity` (`int`) - Database identifier, if known Raises: `ValueError` - Unknown value for `angle` `ValueError` - Unknown value for units `ValueError` - Invalid value for latitude or longitude Overrides: object.__init__

### __str__(self, mode=`'``dms``'`) (Informal representation operator) |
Pretty printed location string
    >>> print(Trigpoint(52.010585, -0.173443, 97.0))
    52°00'38"N, 000°10'24"W alt 97m
    >>> print(Trigpoint(52.010585, -0.173443, 97.0).__str__(mode="dd"))
    N52.011°; W000.173° alt 97m
    >>> print(Trigpoint(52.010585, -0.173443, 97.0).__str__(mode="dm"))
    52°00.64'N, 000°10.41'W alt 97m
    >>> print(Trigpoint(52.010585, -0.173443, 97.0, "Bygrave"))
    Bygrave (52°00'38"N, 000°10'24"W alt 97m)
Parameters: `mode` (`str`) - Coordinate formatting system to use Returns: `str` Human readable string representation of Trigpoint object Raises: `ValueError` - Unknown value for `mode` Overrides: object.__str__