Line | |
---|
1 | if { ![ info exists za ] } { puts "call this file only using verify-*.tcl"; exit }
|
---|
2 |
|
---|
3 | set files [ glob osm-map-features-z*.xml ]
|
---|
4 | set zooms {}
|
---|
5 | foreach f $files {
|
---|
6 | set z [string range [lindex [split [file rootname [file tail $f]] "-"] 3] 1 end]
|
---|
7 | lappend zooms $z
|
---|
8 | set fi [ open $f r ]
|
---|
9 | set in [ read $fi ]
|
---|
10 | close $fi
|
---|
11 | set style($z) ""
|
---|
12 | set flag 0
|
---|
13 | foreach line [ split $in "\n" ] {
|
---|
14 | if { [ string first "<style" $line ] >= 0 } { set flag 1; continue }
|
---|
15 | if { [ string first "</style" $line ] >= 0 } { set flag 0; continue }
|
---|
16 | if { $flag } {
|
---|
17 | set line [ string trim $line ]
|
---|
18 | append style($z) " $line"
|
---|
19 | }
|
---|
20 | }
|
---|
21 | }
|
---|
22 | puts $zooms
|
---|
23 | set zooms [ lsort -integer $zooms ]
|
---|
24 | foreach z $zooms {
|
---|
25 | set widths($z) {}
|
---|
26 | set st [ split $style($z) "{}" ]
|
---|
27 | foreach { a b } $st {
|
---|
28 | set w ""
|
---|
29 | set i [ string last "." $a ]
|
---|
30 | incr i
|
---|
31 | set a [ string trim [ string range $a $i end ] ]
|
---|
32 | set bb [ split $b ":;" ]
|
---|
33 | foreach { c d } $bb {
|
---|
34 | set i [ string first "p" $d ]
|
---|
35 | if { $i >= 0 } { incr i -1; set d [ string trim [ string range $d 0 $i ] ] }
|
---|
36 | if { [ string trim $c ] == "stroke-width" } { set w $d }
|
---|
37 | }
|
---|
38 | lappend widths($z) $a
|
---|
39 | set width($z,$a) $w
|
---|
40 | }
|
---|
41 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.