diff options
author | chris <chris> | 2006-09-20 15:07:58 +0000 |
---|---|---|
committer | chris <chris> | 2006-09-20 15:07:58 +0000 |
commit | 5ebe6ff01d92996f89aac0bfde3fca0a75f1553d (patch) | |
tree | bf6af6169fd89fec57c3579dc040e5a1cf0c7780 | |
parent | c387b49813b60ebb7617bf7b4989eda9394cc356 (diff) |
Ho-hum.
-rwxr-xr-x | maketiles/fixindex | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/maketiles/fixindex b/maketiles/fixindex new file mode 100755 index 000000000..92b449a47 --- /dev/null +++ b/maketiles/fixindex @@ -0,0 +1,26 @@ +#!/usr/bin/perl -w +# +# fixindex: +# Fix the indices generated by the buggy version of 10kfull. +# +# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved. +# Email: chris@mysociety.org; WWW: http://www.mysociety.org/ +# + +my $rcsid = ''; $rcsid .= '$Id: fixindex,v 1.1 2006-09-20 15:07:58 chris Exp $'; + +use strict; + +use constant SUBTILES_PER_TILE => 31; + +while (defined(my $line = <STDIN>)) { + chomp($line); + if ($line =~ /^(0|[1-9]\d*) (0|[1-9]\d*) ([0-9a-f]+)$/) { + my ($x, $y, $id) = ($1, $2, $3); + $y = int($y / SUBTILES_PER_TILE) + + SUBTILES_PER_TILE - 1 - ($y % SUBTILES_PER_TILE); + print "$x $y $id\n"; + } else { + print "$line\n"; + } +} |