aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmaketiles/fixindex26
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";
+ }
+}