initial import

This commit is contained in:
Ben Charlton 2013-02-05 21:42:45 +00:00
parent 7d4c841702
commit 2d06a3e71a
662 changed files with 3950 additions and 0 deletions

32
wmc.pl Normal file
View file

@ -0,0 +1,32 @@
#!/usr/bin/perl
use strict;
use JSON;
use Data::Dumper;
use LWP::Simple;
my $tolerance = '0.005';
my $wmc = 'http://mapit.mysociety.org/areas/WMC';
my $json = JSON->new->allow_nonref;
my $data = get($wmc);
my $all = $json->decode($data);
foreach my $area ( sort { $a <=> $b } keys %$all ) {
my $name = $$all{$area}->{name};
my $geojsonurl = "http://mapit.mysociety.org/area/$area.geojson?simplify_tolerance=$tolerance";
my $file = "data/$area.geojson";
if ((stat($file))[7] == 0) {
print "$area,$name\n";
my $poly = get($geojsonurl);
open F, ">$file";
print F $poly;
close F;
}
sleep 2;
}