~kosova/+junk/openstreetmapkosova

« back to all changes in this revision

Viewing changes to makeindexd.pl

  • Committer: Andreas Horst
  • Date: 2010-12-04 18:24:33 UTC
  • Revision ID: andreas@goetherad-20101204182433-jadrcz03ok0rn7v0
splitting and creating relationships

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
use strict;
 
2
use warnings;
 
3
my %index;
 
4
 
 
5
my $file=undef;
 
6
my $tag=undef;
 
7
my $val=undef;
 
8
while (<>)
 
9
{
 
10
    if (/(\w+_ways_\d+.osm)/)
 
11
    {
 
12
#       warn "$1 \n";
 
13
        $file=$1;
 
14
    }
 
15
    else
 
16
    {
 
17
        die $_;
 
18
    }
 
19
    if (/k=\"(\w+)\"/)
 
20
    {
 
21
#       warn "KEY $1\n";
 
22
        $tag=$1;
 
23
    }
 
24
    else
 
25
    {
 
26
        die $_;
 
27
    }
 
28
 
 
29
    if (/v=\"([\w\#\&\s\;\(\)\,\-\.]+)\"/)
 
30
    {
 
31
#       warn "$1\n";
 
32
        $val=$1;
 
33
        
 
34
        $index{$file}{$tag}=$val;
 
35
#       warn "$file $tag $val";
 
36
    }
 
37
    else
 
38
    {
 
39
        die $_;
 
40
    }
 
41
}
 
42
 
 
43
 
 
44
print "
 
45
======
 
46
{| class=wikitable
 
47
! Department
 
48
! Person
 
49
! Changeset
 
50
";
 
51
 
 
52
foreach my $key (sort keys %index)
 
53
{
 
54
 
 
55
    print "|-\n| " . join (
 
56
        "\n| ",
 
57
        (
 
58
         $index{$key}{"DEPARTAMEN"},
 
59
       "[http://cube.telascience.org/prizren/colombia/" . $key . " $key]",
 
60
         "TODO",
 
61
         "CHANGESET"
 
62
        )
 
63
        )
 
64
        . "\n";
 
65
}
 
66
 
 
67
print "
 
68
|}
 
69
";