source: osm/applications/editors/josm/oldplugins/osmarender/stylesheets/verify.tcl@ 36220

Last change on this file since 36220 was 35743, checked in by stoecker, 4 years ago

readd files directly

File size: 1.2 KB
Line 
1if { ![ info exists za ] } { puts "call this file only using verify-*.tcl"; exit }
2
3set files [ glob osm-map-features-z*.xml ]
4set zooms {}
5foreach 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}
22puts $zooms
23set zooms [ lsort -integer $zooms ]
24foreach 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.