Trees | Indices | Help |
|
---|
|
object --+ | list --+ | Points
Since: 2008-05-02
|
|||
new list |
|
||
str
|
|
||
|
|||
list of float
|
|
||
list of float
|
|
||
list of float
|
|
||
list of 2 tuple of float
|
|
||
list of Point instance
|
|
||
list of Point objects within specified range
|
|
||
|
|||
|
|||
list of datetime.datetime
|
|
||
list of datetime.datetime
|
|
||
list of 2 tuple of datetime.datetime
|
|
||
list of str
|
|
||
Inherited from Inherited from |
|
|||
Inherited from |
|
Initialise a new Points object >>> Points([Point(52.015, -0.221), Point(53.645, -0.284)]) Points([Point(52.015, -0.221, 'metric', 'degrees', 0), Point(53.645, -0.284, 'metric', 'degrees', 0)], False, 'metric') |
Self-documenting string representation >>> locations = [Point(0, 0)] * 4 >>> Points(locations) Points([Point(0.0, 0.0, 'metric', 'degrees', 0), Point(0.0, 0.0, 'metric', 'degrees', 0), Point(0.0, 0.0, 'metric', 'degrees', 0), Point(0.0, 0.0, 'metric', 'degrees', 0)], False, 'metric')
|
Import locations from arguments >>> locations = Points() >>> locations.import_locations(["0;0", "52.015 -0.221"]) >>> locations Points([Point(0.0, 0.0, 'metric', 'degrees', 0), Point(52.015, -0.221, 'metric', 'degrees', 0)], False, 'metric')
|
Calculate distances between locations >>> locations = Points(["52.015;-0.221", "52.168;0.040", "52.855;0.657"], ... parse=True) >>> "%.3f" % sum(locations.distance()) '111.632'
|
Calculate bearing between locations >>> locations = Points(["52.015;-0.221", "52.168;0.040", "52.855;0.657"], ... parse=True) >>> map(lambda x: "%.3f" % x, locations.bearing()) ['46.242', '28.416']
|
Calculate final bearing between locations >>> locations = Points(["52.015;-0.221", "52.168;0.040", "52.855;0.657"], ... parse=True) >>> map(lambda x: "%.3f" % x, locations.final_bearing()) ['46.448', '28.906']
|
Calculate the inverse geodesic between locations >>> locations = Points(["52.015;-0.221", "52.168;0.040", "52.855;0.657"], ... parse=True) >>> locations.inverse() [(46.242393198024672, 24.629669163425465), (28.416173848453582, 87.002075833085328)]
|
Calculate the midpoint between locations >>> locations = Points(["52.015;-0.221", "52.168;0.040", "52.855;0.657"], ... parse=True) >>> locations.midpoint() [Point(52.0915720432, -0.0907237539143, 'metric', 'degrees', 0), Point(52.5119010509, 0.346088603087, 'metric', 'degrees', 0)]
|
Test whether locations are within a given range of the first >>> locations = Points(["52.015;-0.221", "52.168;0.040", "52.855;0.657"], ... parse=True) >>> list(locations.range(Point(52.015, -0.221), 20)) [Point(52.015, -0.221, 'metric', 'degrees', 0)] |
Calculate destination locations for given distance and bearings >>> locations = Points(["52.015;-0.221", "52.168;0.040", "52.855;0.657"], ... parse=True) >>> list(locations.destination(42, 240)) [Point(53.5956078217, 2.2141813684, 'metric', 'degrees', 0), Point(53.7484691495, 2.48403821375, 'metric', 'degrees', 0), Point(54.4348338045, 3.14183478498, 'metric', 'degrees', 0)]
|
Calculate destination locations for given distance and bearings >>> locations = Points(["52.015;-0.221", "52.168;0.040", "52.855;0.657"], ... parse=True) >>> list(locations.destination(42, 240)) [Point(53.5956078217, 2.2141813684, 'metric', 'degrees', 0), Point(53.7484691495, 2.48403821375, 'metric', 'degrees', 0), Point(54.4348338045, 3.14183478498, 'metric', 'degrees', 0)]
|
Calculate sunrise times for locations >>> locations = Points(["52.015;-0.221", "52.168;0.040", "52.855;0.657"], ... parse=True) >>> import datetime >>> list(locations.sunrise(datetime.date(2008, 5, 2))) [datetime.time(4, 28), datetime.time(4, 26), datetime.time(4, 21)]
|
Calculate sunset times for locations >>> locations = Points(["52.015;-0.221", "52.168;0.040", "52.855;0.657"], ... parse=True) >>> import datetime >>> list(locations.sunset(datetime.date(2008, 5, 2))) [datetime.time(19, 29), datetime.time(19, 28), datetime.time(19, 28)]
|
Calculate sunrise/sunset times for locations >>> locations = Points(["52.015;-0.221", "52.168;0.040", "52.855;0.657"], ... parse=True) >>> import datetime >>> list(locations.sun_events(datetime.date(2008, 5, 2))) [(datetime.time(4, 28), datetime.time(19, 29)), (datetime.time(4, 26), datetime.time(19, 28)), (datetime.time(4, 21), datetime.time(19, 28))]
|
Calculate Maidenhead locator for locations >>> locations = Points(["52.015;-0.221", "52.168;0.040", "52.855;0.657"], ... parse=True) >>> list(locations.to_grid_locator("extsquare")) ['IO92va33', 'JO02ae40', 'JO02hu85'] >>> list(locations.to_grid_locator("subsquare")) ['IO92va', 'JO02ae', 'JO02hu']
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue May 20 12:41:44 2008 | http://epydoc.sourceforge.net |