geo package¶
geo (Geographic)¶
Author:
Dirk Alders <sudo-dirk@mount-mockery.de>
Description:
This Module support functionalities around geographic issues.
Submodules:
Submodules¶
geo.gps module¶
geo.gps (Geo-Positioning)¶
Author:
Dirk Alders <sudo-dirk@mount-mockery.de>
Description:
This module is a submodule of
geo
and includes functions and classes for geographic issues (e.g. coordinate, area, tracks, …).
Contentlist:
- class geo.gps.area(coord1, coord2)¶
Bases:
object
- Parameters:
coord1 (coordinate) – Corner Coordinate 1
coord2 (coordinate) – Corner Coordinate 2
Class to store a geographic area and support some calculations.
Example:
>>> import geo >>> ar = geo.gps.area(...)
- center_pos()¶
Warning
Needs sphinx documentation!
- coordinate_in_area(coord)¶
Warning
Needs sphinx documentation!
- corner_coordinates()¶
Warning
Needs sphinx documentation!
- extend_area(coord)¶
Warning
Needs sphinx documentation!
- osm_map(map_code)¶
- Parameters:
map_code – Map code as defined in
geo.osm
(e.g.geo.osm.MAP_STANDARD
)
This Method returns a
geo.osm.map
instance.Warning
Needs sphinx documentation!
- class geo.gps.coordinate(**kwargs)¶
Bases:
dict
- Parameters:
lon (float) – Londitude
lat (float) – Latitude
height (float) – Height
time (int) – Time (Seconds since 1970)
Class to store a geographic coodinate and support some calculations.
Example:
>>> import geo >>> ab = geo.gps.coordinate(lat=49.976596,lon=9.1481443) >>> gb = geo.gps.coordinate(lat=53.6908298,lon=12.1583252) >>> ab.dist_to(gb) / 1000 462.3182843470017 >>> ab.angle_to(gb) / math.pi * 180 39.02285256685333
- HIGHT = 'hight'¶
- LATITUDE = 'lat'¶
- LONGITUDE = 'lon'¶
- TIME = 'time'¶
- angle_to(coord)¶
This Method calculates the geographic direction in radiant from this to the given coordinate.
Note
North is 0 (turning right). That means east is
math.pi
/2.- Parameters:
coord (corrdinate) – Target coordinate.
- Returns:
The geographic direction in radiant.
- Return type:
int or float
- dist_to(coord)¶
This Method calcultes the distance from this coordinate to a given coordinate.
- Parameters:
coord (coordinate) – Target coordinate.
- Returns:
The distance between two coordinates in meters.
- Return type:
int or float
- Raises:
- class geo.gps.track¶
Bases:
list
Class to store a a tracks and support some calculations.
Example:
>>> import geo >>> ...
- append(coord)¶
Warning
Needs to be documented
- area()¶
- Return type:
geo.gps.area or None
Warning
Needs to be documented
- average_speed()¶
Warning
Needs to be documented
- end_date()¶
Warning
Needs to be documented
- extend(*args, **kwargs)¶
Warning
Needs to be documented
- hightcharacteristic()¶
Warning
Needs to be documented
- insert(index, coord)¶
Warning
Needs to be documented
- name()¶
Warning
Needs to be documented
- optimized_track()¶
Warning
Needs to be documented
- osm_map(map_code)¶
- passed_hight()¶
Warning
Needs to be documented
- set_name(name)¶
Warning
Needs to be documented
- speedcharacteristic()¶
Warning
Needs to be documented
- start_date()¶
Warning
Needs to be documented
- total_distance()¶
Warning
Needs to be documented
- total_time()¶
Warning
Needs to be documented
geo.osm module¶
geo.osm (Open Streetmap)¶
Author:
Dirk Alders <sudo-dirk@mount-mockery.de>
Description:
This module is a submodule of
geo
and supports functions and classes for Open Streetmap.
Contentlist:
- geo.osm.MAP_CYCLEMAP = 'CN'¶
MAP definition for Cyclemap
- geo.osm.MAP_HUMANITARIAN = 'HN'¶
MAP definition for Humanitarian Map
- geo.osm.MAP_LOCAL_TRAFIC = 'TN'¶
MAP definition for Local Trafic Map
- geo.osm.MAP_STANDARD = 'N'¶
MAP definition for Standard Map
- geo.osm.landmark_link(coord, zoom_level=13, map_code='N')¶
- Parameters:
coord (geo.gps.coordinate) – Target coordinate.
zoom_level (int) – The zoom level of the map (see https://wiki.openstreetmap.org/wiki/Zoom_levels for more information)
map_code (str) – One of the map_codes
MAP_STANDARD
,MAP_LOCAL_TRAFIC
,MAP_CYCLEMAP
,MAP_HUMANITARIAN
.
- Returns:
An openstreetmap-url for marking a position in a map.
- Return type:
str
This Method generates an openstreetmap-url for marking a position in a map.
>>> import geo >>> gb = geo.gps.coordinate(lat=53.6908298,lon=12.1583252) >>> geo.osm.landmark_link(gb) 'http://www.openstreetmap.org?mlat=53.690830&mlon=12.158325&zoom=13&layers=N'
- class geo.osm.map_spec(**kwargs)¶
Bases:
object
- coord_to_point(coord)¶
- get_coord_range()¶
- get_map()¶
- get_resolution()¶
- point_to_coord(xy)¶
- class geo.osm.osm_map(**kwargs)¶
Bases:
object
geo.sun module¶
geo.sun (Sun)¶
Author:
Dirk Alders <sudo-dirk@mount-mockery.de>
Formula from Dr. Roland Brodbeck, Calsky (http://lexikon.astronomie.info/zeitgleichung/neu.html)
First implementation by Alexander Klupp 2014-01-14
Description:
This module is a submodule of
geo
and supports functions and classes for sun position.
Contentlist:
- geo.sun.BerechneZeitgleichung(T)¶
- geo.sun.InPi(x)¶
- geo.sun.JulianischesDatum(Jahr, Monat, Tag, Stunde, Minuten, Sekunden)¶
- geo.sun.Sonnenauf_untergang(JD, Zeitzone, coord)¶
- geo.sun.eps(T)¶
- geo.sun.sunrise(coord={'lat': 52.520008, 'lon': 13.404954}, date=None)¶
- Parameters:
coord (geo.gps.coordinate) – Target coordinate or None (default is central europe).
date (time.struct_time) – The day to calculate with or None (only year, month and day are relevant; default ist today)
- Returns:
The date and time information for the sunrise
- Return type:
time.struct_time
This Method calculates the time for sunrise for a given date and coordinate.
>>> import geo >>> ...
- geo.sun.sunset(coord={'lat': 52.520008, 'lon': 13.404954}, date=None)¶
- Parameters:
coord (geo.gps.coordinate) – Target coordinate or None (default is central europe).
date (time.struct_time) – The day to calculate with or None (only year, month and day are relevant; default ist today)
- Returns:
The date and time information for the sunset
- Return type:
time.struct_time
This Method calculates the time for sunrise for a given date and coordinate.
>>> import geo >>> ...