Lògo d'OpenStreetMap OpenStreetMap

My gps traces on a map.

Postat per the_winch a 11 de febrièr 2009 en 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.

Email icon Bluesky Icon Facebook Icon LinkedIn Icon Mastodon Icon Telegram Icon X Icon

Discussion

Comentari de kaerast lo 12 de febrièr 2009 a 11:06

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

Comentari de the_winch lo 12 de febrièr 2009 a 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$

Connectatz-vos per ajustar un comentari