OpenStreetMap 标志 OpenStreetMap

My gps traces on a map.

the_winch 于 2009年二月11日 以 English 发布

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.

电子邮件图标 Bluesky图标 Facebook图标 LinkedIn图标 Mastodon图标 Telegram图标 X图标

讨论

kaerast2009年02月12日 11:06 的评论

What are the couple of extra lines you added to generate_tiles.py? That seems quite a useful addition in some cases.

the_winch2009年02月12日 18:42 的评论

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$

登录以留下评论