Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Barry Carter authored and Barry Carter committed Oct 24, 2011
1 parent 9ab90d2 commit 8d145e3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions bc-kml-lib.pl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

TODO: this seems to leave off one (or more?) points, not sure why

TODO: option for placemarks at the points themselves

=cut

sub voronoi_map {
Expand Down
2 changes: 2 additions & 0 deletions bc-temperature-voronoi.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
push(@INC,"/usr/local/lib");
require "bclib.pl";

warn "This program is semi-obsolete; you probably want bc-voronoi-temperature.pl";

# the KML file created here is visible at
# http://wordpress.barrycarter.info/index.php/voronoi-temperature-map/
# --showpoints: show individual stations (doesn't work well)
Expand Down
5 changes: 4 additions & 1 deletion bc-voronoi-temperature.pl
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@
next;
}

# no temperature? no go!
if ($hash{temp_c} eq "NULL" || $hash{temp_c} eq "") {next;}

# TODO: mercator version?
# fields for voronoi_map()
$hash{x} = $hash{longitude};
$hash{y} = $hash{latitude};
$hash{id} = $hash{station_id};
$hash{label} = ""; # TODO: change this, maybe
$hash{label} = "$hash{station_id}: $hash{temp_c}"; # TODO: change this, maybe
$f= $hash{temp_c}*1.8+32;
$hue = 5/6-($f/100)*5/6;
$hash{color} = hsv2rgb($hue, 1, 1, "kml=1&opacity=80");
Expand Down
3 changes: 3 additions & 0 deletions bc-weather-lib.pl
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,9 @@ sub recent_weather {
my($options) = @_;
my(@headers, @hashes);
my($res) = cache_command("curl http://weather.aero/dataserver_current/cache/metars.cache.csv.gz | gunzip | tail -n +6", "age=300");
# this file is important enough to keep around
write_file($res, "/var/tmp/weather.aero.metars.txt");

my(@res) = split(/\n/, $res);

# header line
Expand Down

0 comments on commit 8d145e3

Please sign in to comment.