upoints.cities.City

Package upoints :: Module cities :: Class City |
[hide private]
[frames] | no frames]

# Class City

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

Class for representing an entry from the GNU miscfiles cities data file

Since: 0.2.0

Instance Methods | [hide private]
__init__(self, identifier, name, ptype, region, country, location, population, size, latitude, longitude, altitude, date, entered) Initialise a new City object |
`str` |
__str__(self, mode=None) 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
| country Country the place is in
| date Entry date
| entered Entry's author
| identifier Numeric identifier for object
| latitude Location's latitude
| location Body, always Earth in miscfiles 1.4.2
| longitude Locations's longitude
| name Location's name
| population Place population, if known
| ptype Place type
| region Region the place is in
| size Place Size
Inherited from `trigpoints.Trigpoint`: `identity` 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, identifier, name, ptype, region, country, location, population, size, latitude, longitude, altitude, date, entered) (Constructor) |
Initialise a new City object
    >>> City(498, "Zwickau", "City", "Sachsen", "DE", "Earth", 108835,
    ...      None, 12.5, 50.72, None, (1997, 4, 10, 0, 0, 0, 3, 100, -1),
    ...      "M.Dowling@tu-bs.de")
    City(498, 'Zwickau', 'City', 'Sachsen', 'DE', 'Earth', 108835, None,
         12.5, 50.72, None, (1997, 4, 10, 0, 0, 0, 3, 100, -1),
         'M.Dowling@tu-bs.de')
Parameters: `identifier` (`int`) - Numeric identifier for object `name` (`str`) - Place name `ptype` (`str`) - Type of place `region` (`str` or `None`) - Region place can be found `country` (`str` or `None`) - Country name place can be found `location` (`str`) - Body place can be found `population` (`int` or `None`) - Place's population `size` (`int` or `None`) - Place's area `latitude` (`float`) - Station's latitude `longitude` (`float`) - Station's longitude `altitude` (`int` or `None`) - Station's elevation `date` (`time.struct_time`) - Date the entry was added `entered` (`str` or `None`) - Entry's author Raises: `ValueError` - Unknown value for `angle` `ValueError` - Unknown value for units `ValueError` - Invalid value for latitude or longitude Overrides: object.__init__

### __str__(self, mode=None) (Informal representation operator) |
Pretty printed location string
    >>> t = City(498, "Zwickau", "City", "Sachsen", "DE", "Earth", 108835,
    ...          None, 50.72, 12.5, None,
    ...          (1997, 4, 10, 0, 0, 0, 3, 100, -1), "M.Dowling@tu-bs.de")
    >>> print(t)
    ID          : 498
    Type        : City
    Population  : 108835
    Size        :
    Name        : Zwickau
     Country    : DE
     Region     : Sachsen
    Location    : Earth
     Longitude  : 12.5
     Latitude   : 50.72
     Elevation  :
    Date        : 19970410
    Entered-By  : M.Dowling@tu-bs.de
Parameters: `mode` (`None`) - Dummy parameter to maintain signature of trigpoints.Trigpoint.__str__ Returns: `str` Human readable string representation of City object Raises: `ValueError` - Unknown value for `mode` Overrides: object.__str__