Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Comment: | Yay! Working prototype. Will sum up the distances of headwinds...
...for a polyline route. I'd made silly mistakes like forgetting which order the list of tuples Now need to extend this to sum up all wind directions and check for |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk | origin/master |
Files: | files | file ages | folders |
SHA3-256: |
289839a15dc8ba8abcda246e2932e1e2 |
User & Date: | base@atomicules.co.uk 2014-11-29 17:52:12 |
2014-11-30
| ||
11:02 |
Extend functionality to sum up all wind directions
by mapping. Need to tidy up formatting and make it consistent and sort out the | |
2014-11-29
| ||
17:52 |
Yay! Working prototype. Will sum up the distances of headwinds...
...for a polyline route. I'd made silly mistakes like forgetting which order the list of tuples Now need to extend this to sum up all wind directions and check for | |
17:42 |
Merge branch 'master' into osrm
Noticed the nth_wrap problem whilst developing this osrm branch as | |
Changes to headsilose.erl.
︙ | ︙ | |||
201 202 203 204 205 206 207 | [Headwinds, Sidewinds, Tailwinds] = build_list_of_wind_directions(Direction), %Ok so now map this list over (like previous function) the headings list to get list of head, side, tail and distances? {_Checksum, Polyline} = osrm:read_route(), Polyline_decoded = polyline:decode(Polyline), List_of_distances_and_compass = convert_lats_longs_to_distance_heading(Polyline_decoded), %If now have a set of co-ords need to figure out distances and directions | | | | | | < | 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | [Headwinds, Sidewinds, Tailwinds] = build_list_of_wind_directions(Direction), %Ok so now map this list over (like previous function) the headings list to get list of head, side, tail and distances? {_Checksum, Polyline} = osrm:read_route(), Polyline_decoded = polyline:decode(Polyline), List_of_distances_and_compass = convert_lats_longs_to_distance_heading(Polyline_decoded), %If now have a set of co-ords need to figure out distances and directions List_of_distances_and_wind = lists:map(fun({Distance, Compass}) -> Wind = head_side_or_tail_wind(Compass, [Headwinds, Sidewinds, Tailwinds]), {Distance, Wind} end, List_of_distances_and_compass), %lists:map to get distnaces only? Could also map each of the winds? %Figure out for headwinds only for now Headw = lists:filter(fun({_Distance, Wind_type}) -> Wind_type == headwind end, List_of_distances_and_wind), Sum_of_Headw = lists:foldl(fun({Distance2, _Wind}, Sum) -> Distance2 + Sum end, 0, Headw). %io:format("Direction: ~s~nSpeed: ~s mph~nGust: ~s mph~nWeather type: ~s~nTemperature: ~s deg C~n", [Direction, Speed, Gust, Weather_type, Temperature]). %Need to read API key from file readapikey() -> {_Status, KeyB} = file:read_file(os:getenv("HOME") ++ "/.datapoint"), string:strip(erlang:binary_to_list(KeyB),right,$\n). |