I downloaded all my gps traces.
Used a simple ruby script to convert them to a .osm file. Each gps point became a node with an amenity=post_box tag.
Used osm2pgsql to import the .osm file into PostGIS.
Cut down the mapnik stylesheet so it only rendered postboxes using a 1x1 black box.
Added a couple of lines to generate_tiles.py to delete blank tiles. Then generated the tiles for zoom 8 to 17 in the area of my gps traces.
The result can be seen here.
토론
2009년 2월 12일 11:06에 kaerast님의 의견
What are the couple of extra lines you added to generate_tiles.py? That seems quite a useful addition in some cases.
2009년 2월 12일 18:42에 the_winch님의 의견
Looking at it I only added a single line. generate_tiles.py already checks for blank tiles by comparing the file size of a tile against a hardcoded value. I just addeed a line to delete the blank file.
Index: generate_tiles.py
===================================================================
--- generate_tiles.py (revision 13578)
+++ generate_tiles.py (working copy)
@@ -99,8 +99,9 @@
bytes=os.stat(tile_uri)[6]
empty= ''
- if bytes == 137:
+ if bytes == 360:
empty = " Empty Tile "
+ os.remove(tile_uri)
print name,"[",minZoom,"-",maxZoom,"]: " ,z,x,y,"p:",p0,p1,exi$