--- ../tilesAtHome/tilesGen.pl 2007-03-27 15:19:27.000000000 +0200 +++ tilesGen-maplint.pl 2007-04-04 00:22:53.000000000 +0200 @@ -149,7 +149,7 @@ my $Count = 0; opendir(my $dp, $Config{WorkingDirectory}) || return; while(my $File = readdir($dp)){ - $Count++ if($File =~ /tile_.*\.png/); + $Count++ if($File =~ /maplint_.*\.png/); } closedir($dp); @@ -313,7 +313,33 @@ my $URL = sprintf("http://%s:%s\@www.openstreetmap.org/api/0.3/map?bbox=%f,%f,%f,%f", $Config{OsmUsername}, $Config{OsmPassword}, $W1, $S1, $E1, $N1); - DownloadFile($URL, $DataFile, 0, "Map data to $DataFile"); + # DownloadFile($URL, $DataFile, 0, "Map data to $DataFile"); + + # The necessary data file is already here... + my $DataFile = "data-maplinted-$PID.osm"; + + my $Cmd1 = sprintf("%s \"%s\" tr %s %s > \"%s\"", + $Config{Niceness}, + $Config{XmlStarlet}, + "lib/run-tests.xsl", + "data.osm", + "temp-$PID.osm"); + + runCommand("run-tests", $Cmd1); + + my $Cmd2 = sprintf("%s \"%s\" tr %s %s > \"%s\"", + $Config{Niceness}, + $Config{XmlStarlet}, + "lib/convert-to-tags.xsl", + "temp-$PID.osm", + "$DataFile"); + + runCommand("convert-to-tags", $Cmd2); + + killafile("data.osm"); + killafile("temp-$PID.osm"); + + if(-s $DataFile == 0){ printf("No data at this location\n"); printf("Trying smaller slices...\n"); @@ -379,7 +405,7 @@ # Create a new copy of osmarender copy( - "osm-map-features-z$i.xml", + "osm-maplint-features-z$i.xml", "osm-map-features-$PID-z$i.xml") or die "Cannot make copy of osm-map-features-z$i.xml"; @@ -583,6 +609,9 @@ # Pre-process on OSM file (using frollo) #----------------------------------------------------------------------------- sub frollo { + + return 1; + my($dataFile) = @_; my $Cmd = sprintf("%s \"%s\" tr %s %s > \"%s\"", $Config{Niceness}, @@ -651,7 +680,7 @@ $Config{Niceness}, $TSVG, $SVG); - runCommand("Beziercurvehinting $what", $Cmd); + # runCommand("Beziercurvehinting $what", $Cmd); #----------------------------------------------------------------------------- # Sanitycheck for Bezier curve hinting, no output = bezier curve hinting failed #----------------------------------------------------------------------------- @@ -801,7 +830,7 @@ die("no such $Filename") if(! -f $Filename); # Change some stuff - my $DataSource = sprintf("data-%s.osm", + my $DataSource = sprintf("data-maplinted-%s.osm", $PID); $Data =~ s/( data=\").*( scale=\")/$1$DataSource\"\n$2/s; @@ -834,7 +863,7 @@ sub tileFilename { my($X,$Y,$Zoom) = @_; - return(sprintf("%s/tile_%d_%d_%d.png",$Config{WorkingDirectory},$Zoom,$X,$Y)); + return(sprintf("%s/maplint_%d_%d_%d.png",$Config{WorkingDirectory},$Zoom,$X,$Y)); } #-----------------------------------------------------------------------------