Trees | Indices | Help |
|
---|
|
object --+ | list --+ | upoints.point.Points --+ | NumberedPoints
Since: 2008-01-08
|
|||
new list |
|
||
str
|
|
||
|
|||
|
|||
list of float
|
|
||
list of float
|
|
||
list of Point objects within specified range
|
|
||
|
|||
list of 2 tuple of datetime.datetime
|
|
||
|
|||
Inherited from Inherited from Inherited from |
|
|||
Inherited from |
|
|
Self-documenting string representation >>> locations = ["0;0"] * 4 >>> NumberedPoints(locations) NumberedPoints([NumberedPoint(0.0, 0.0, 1, 'metric'), NumberedPoint(0.0, 0.0, 2, 'metric'), NumberedPoint(0.0, 0.0, 3, 'metric'), NumberedPoint(0.0, 0.0, 4, 'metric')], 'dd', True, True, None, 'km')
|
Import locations from arguments >>> NumberedPoints(["0;0", "Home", "0;0"], ... config_locations={"Home": (52.015, -0.221)}) NumberedPoints([NumberedPoint(0.0, 0.0, 1, 'metric'), NumberedPoint(52.015, -0.221, 'Home', 'metric'), NumberedPoint(0.0, 0.0, 3, 'metric')], 'dd', True, True, {'Home': (52.015000000000001, -0.221)}, 'km')
|
Pretty print locations >>> locations = NumberedPoints(["Home", "52.168;0.040"], ... config_locations={"Home": (52.015, -0.221)}) >>> locations.display(None) Location Home is N52.015°; W000.221° Location 2 is N52.168°; E000.040° >>> locations.format = "locator" >>> locations.display("extsquare") Location Home is IO92va33 Location 2 is JO02ae40 >>> locations.verbose = False >>> locations.display("extsquare") IO92va33 JO02ae40
|
Calculate distances between locations >>> locations = NumberedPoints(["52.015;-0.221", "52.168;0.040"]) >>> locations.distance() Location 1 to 2 is 24 kilometres >>> locations = NumberedPoints(["52.015;-0.221", "52.168;0.040"], units="sm") >>> locations.distance() Location 1 to 2 is 15 miles >>> locations = NumberedPoints(["52.015;-0.221", "52.168;0.040"], units="nm") >>> locations.verbose = False >>> locations.distance() 13.2989574317 >>> locations = NumberedPoints(["52.015;-0.221", "52.168;0.040", ... "51.420;-1.500"]) >>> locations.distance() Location 1 to 2 is 24 kilometres Location 2 to 3 is 134 kilometres Total distance is 159 kilometres
|
Calculate bearing/final bearing between locations >>> locations = NumberedPoints(["52.015;-0.221", "52.168;0.040"]) >>> locations.bearing("bearing", False) Location 1 to 2 is 46° >>> locations.bearing("bearing", True) Location 1 to 2 is North-east >>> locations.bearing("final_bearing", False) Final bearing from location 1 to 2 is 46° >>> locations.bearing("final_bearing", True) Final bearing from location 1 to 2 is North-east >>> locations.verbose = False >>> locations.bearing("bearing", True) North-east >>> locations.verbose = False >>> locations.bearing("final_bearing", True) North-east
|
Test whether locations are within a given range of the first >>> locations = NumberedPoints(["52.015;-0.221", "52.168;0.040"]) >>> locations.range(20) Location 2 is not within 20 kilometres of location 1 >>> locations.range(30) Location 2 is within 30 kilometres of location 1 >>> locations.verbose = False >>> locations.range(30) True
|
Calculate destination locations for given distance and bearings >>> locations = NumberedPoints(["52.015;-0.221", "52.168;0.040"]) >>> locations.destination((42, 240), False) Destination from location 1 is N51.825°; W000.751° Destination from location 2 is N51.978°; W000.491° >>> locations.format = "locator" >>> locations.destination((42, 240), "subsquare") Destination from location 1 is IO91ot Destination from location 2 is IO91sx >>> locations.verbose = False >>> locations.destination((42, 240), "extsquare") IO91ot97 IO91sx14
|
Calculate sunrise/sunset times for locations >>> locations = NumberedPoints(["52.015;-0.221", "52.168;0.040"]) >>> locations.sun_events("sunrise") # doctest: +ELLIPSIS Sunrise at ... in location 1 Sunrise at ... in location 2 >>> locations.sun_events("sunset") # doctest: +ELLIPSIS Sunset at ... in location 1 Sunset at ... in location 2
|
Output the flight plan corresponding to the given locations TODO: Description >>> locations = NumberedPoints(["52.015;-0.221", "52.168;0.040", ... "52.249;0.130", "52.494;0.654"]) >>> locations.flight_plan(0, "h") WAYPOINT,BEARING[°],DISTANCE[km],ELAPSED_TIME[h],LATITUDE[d.dd],LONGITUDE[d.dd] 1,,,,52.015000,-0.221000 2,46,24.6,,52.168000,0.040000 3,34,10.9,,52.249000,0.130000 4,52,44.8,,52.494000,0.654000 -- OVERALL --#,,80.3,,, -- DIRECT --#,47,79.9,,, >>> locations = NumberedPoints(["52.015;-0.221", "52.168;0.040", ... "52.249;0.130", "52.494;0.654"], ... units="nm") >>> locations.flight_plan(20, "m") WAYPOINT,BEARING[°],DISTANCE[nm],ELAPSED_TIME[m],LATITUDE[d.dd],LONGITUDE[d.dd] 1,,,,52.015000,-0.221000 2,46,13.3,0.7,52.168000,0.040000 3,34,5.9,0.3,52.249000,0.130000 4,52,24.2,1.2,52.494000,0.654000 -- OVERALL --,,43.4,2.2,, -- DIRECT --,47,43.1,2.2,,
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue May 20 12:41:09 2008 | http://epydoc.sourceforge.net |