Hi folks, My first post to the Dev list :)
Following a short discussion on the [EMAIL PROTECTED] list about lowzoom, I prepared the attached patch. It combines (a) the layers.conf changes suggested by 'jth' on the lowzoom wiki page with (b) a change to tilesGen.pl that confines the downloaded data for the lowzoom caption tiles to just large placenames. Any opinions? In my tests it worked fine for generating the caption tiles for Ireland, and saved megabytes of bandwidth per tile. Cheers, Andrew
Index: layers.conf
===================================================================
--- layers.conf (revision 7418)
+++ layers.conf (working copy)
@@ -60,24 +60,28 @@
Layer.lowzoom.MaxZoom=11
# osmarender rule files to be used, one for each level
-Layer.lowzoom.Rules.6=osmarender/osm-map-features-z6.xml
-Layer.lowzoom.Rules.7=osmarender/osm-map-features-z7.xml
-Layer.lowzoom.Rules.8=osmarender/osm-map-features-z8.xml
-Layer.lowzoom.Rules.9=osmarender/osm-map-features-z9.xml
-Layer.lowzoom.Rules.10=osmarender/osm-map-features-z10.xml
-Layer.lowzoom.Rules.11=osmarender/osm-map-features-z11.xml
+Layer.lowzoom.Rules.6=osmarender/caption-z6.xml
+Layer.lowzoom.Rules.7=osmarender/caption-z7.xml
+Layer.lowzoom.Rules.8=osmarender/caption-z8.xml
+Layer.lowzoom.Rules.9=osmarender/caption-z9.xml
+Layer.lowzoom.Rules.10=osmarender/caption-z10.xml
+Layer.lowzoom.Rules.11=osmarender/caption-z11.xml
-#lowzoom prefix should also be 'tile' to upload into the regular tile layer
-Layer.lowzoom.Prefix=tile
+# lowzoom prefix should be 'caption'. Regular tiles are later produced by
+# stitching captionless tiles together and then overlaying these caption tiles.
+Layer.lowzoom.Prefix=caption
Layer.lowzoom.Preprocessor=close-areas
-# default layer is not transparent
+# lowzoom caption layer is transparent
Layer.lowzoom.Transparent=1
-# default layer does not need to render full tileset
+# lowzoom caption layer is needed at all levels
Layer.lowzoom.RenderFullTileset=1
+# Lowzoom captions need very little data. Specify exactly which xapi predicates we need.
+Layer.lowzoom.Predicates=node[place=town|city|country]
+
# Details for "POI" layer
# ---------------------------
Index: tilesGen.pl
===================================================================
--- tilesGen.pl (revision 7418)
+++ tilesGen.pl (working copy)
@@ -680,19 +680,16 @@
$Config{APIURL},$Config{OSMVersion},$bbox);
if ($Zoom < 12)
{
- # FIXME: hardcoded: assume lowzoom layer now!
- $Layers="lowzoom" if ($Mode eq "xy");
+ # Assume lowzoom layer now!
+ $Layers="lowzoom";
- # We only need the bounding box for ways (they will be downloaded completly,
- # but need the extended bounding box for places (names from neighbouring tiles)
- $URLS = sprintf("%s%s/way[natural=*][bbox=%s] %s%s/way[boundary=*][bbox=%s] %s%s/way[landuse=*][bbox=%s] %s%s/way[highway=motorway|motorway_link|trunk|primary|secondary|tertiary][bbox=%s] %s%s/way[waterway=river][bbox=%s] %s%s/way[railway=*][bbox=%s] %s%s/node[place=*][bbox=%s]",
- $Config{XAPIURL},$Config{OSMVersion},$bbox,
- $Config{XAPIURL},$Config{OSMVersion},$bbox,
- $Config{XAPIURL},$Config{OSMVersion},$bbox,
- $Config{XAPIURL},$Config{OSMVersion},$bbox,
- $Config{XAPIURL},$Config{OSMVersion},$bbox,
- $Config{XAPIURL},$Config{OSMVersion},$bbox,
- $Config{XAPIURL},$Config{OSMVersion},$bbox);
+ # Get the predicates for lowzoom, and build the URLS for them
+ my $predicates = $Config{"Layer.$Layers.Predicates"};
+ $URLS="";
+ foreach my $predicate (split(/,/,$predicates)) {
+ $URLS = $URLS . sprintf("%s%s/%s[bbox=%s] ",
+ $Config{XAPIURL},$Config{OSMVersion},$predicate,$bbox);
+ }
}
my @tempfiles;
push(@tempfiles, $DataFile);
signature.asc
Description: Digital signature
_______________________________________________ dev mailing list [email protected] http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev

