Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Introduced dependency on StreetNames and shortname output from skelet…

…ron-osm-streets.py
  • Loading branch information...
commit f95072f236a1f70f4cb8688cc63a7cf24e228522 1 parent ddd6362
authored June 01, 2012
1  README.txt
@@ -12,6 +12,7 @@ Required dependencies:
12 12
   - shapely 1.2+ (http://pypi.python.org/pypi/Shapely)
13 13
   - pyproj (http://code.google.com/p/pyproj)
14 14
   - networkx 1.5+ (http://networkx.lanl.gov)
  15
+  - StreetNames 0.1+ (https://github.com/nvkelso/map-label-style-manual/tree/master/tools/street_names)
15 16
 
16 17
 You'd typically use it via one of the provided utility scripts, currently
17 18
 just these two:
2  setup.py
@@ -10,7 +10,7 @@
10 10
       author='Michal Migurski',
11 11
       author_email='mike@stamen.com',
12 12
       url='https://github.com/migurski/Skeletron',
13  
-      requires=['networkx'],
  13
+      requires=['networkx', 'StreetNames'],
14 14
       packages=['Skeletron'],
15 15
       scripts=['skeletron-osm-route-rels.py', 'skeletron-osm-streets.py'],
16 16
     # download_url='https://github.com/downloads/migurski' % locals(),
8  skeletron-osm-streets.py
@@ -13,6 +13,8 @@
13 13
 from json import dump
14 14
 from math import pi
15 15
 
  16
+from StreetNames import short_street_name
  17
+
16 18
 from Skeletron import waynode_multilines
17 19
 from Skeletron.input import parse_street_waynodes
18 20
 from Skeletron.output import multilines_geojson
@@ -63,11 +65,13 @@
63 65
     if options.use_highway:
64 66
         def key_properties((name, highway)):
65 67
             return dict(name=name, highway=highway,
66  
-                        zoomlevel=options.zoom, pixelwidth=options.width)
  68
+                        zoomlevel=options.zoom, pixelwidth=options.width,
  69
+                        shortname=short_street_name(name))
67 70
     else:
68 71
         def key_properties((name, )):
69 72
             return dict(name=name,
70  
-                        zoomlevel=options.zoom, pixelwidth=options.width)
  73
+                        zoomlevel=options.zoom, pixelwidth=options.width,
  74
+                        shortname=short_street_name(name))
71 75
 
72 76
     print >> stderr, 'Buffer: %(buffer).1f, density: %(density).1f, minimum length: %(min_length).1f, minimum area: %(min_area).1f.' % kwargs
73 77
     print >> stderr, '-' * 20

0 notes on commit f95072f

Please sign in to comment.
Something went wrong with that request. Please try again.