diff --git a/README.md b/README.md new file mode 100644 index 0000000..b37980b --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +Map generation +-------------- + +**Requirements**: Python 2.7. + + python mapper.py -i -o + +### Options ### + + + +
-bbox, --boundary-box + +Boundary box to draw + +
--show-missed-tags + +Show not drawed tags as text + +
+ diff --git a/doc/readme.moi b/doc/readme.moi new file mode 100644 index 0000000..928108d --- /dev/null +++ b/doc/readme.moi @@ -0,0 +1,14 @@ +\2 {Map generation} {map_generation} + +\b {Requirements}: Python 2.7. + +\code +{python mapper.py -i \formal {input OSM XML file name} -o \formal {output SVG file name} } + +\3 {Options} + +\table +{ + {{\tt {-bbox}, \tt {--boundary-box}} {Boundary box to draw}} + {{\tt {--show-missed-tags}} {Show not drawed tags as text}} +} diff --git a/mapper.py b/mapper.py index d7a0ef2..88dbf29 100644 --- a/mapper.py +++ b/mapper.py @@ -253,7 +253,7 @@ def line_center(node_ids): return Vector((ma.x + mi.x) / 2.0, (ma.y + mi.y) / 2.0) -def draw_ways(): +def draw_ways(show_missed_tags=False): for level in sorted(layers.keys()): layer = layers[level] #for entity in ['b', 'h1', 'h2', 'r', 'n', 'l', 'a', 'le', 'ba']: @@ -387,7 +387,7 @@ def draw_ways(): draw_path(way['nodes'], 'fill:#D0D0C0;stroke:#AAAAAA;opacity:1.0;') c = line_center(way['nodes']) shapes, fill, processed = get_icon(way['tags'], scheme, '444444') - draw_shapes(shapes, True, points, c.x, c.y, fill, True, way['tags'], processed) + draw_shapes(shapes, True, points, c.x, c.y, fill, show_missed_tags, way['tags'], processed) for tag in way['tags']: v = way['tags'][tag] if tag == 'building': @@ -689,7 +689,7 @@ if options['draw_ways']: icons = extract_icon.IconExtractor('icons.svg') if options['draw_ways']: - draw_ways() + draw_ways(show_missed_tags=options['show_missed_tags']) draw_nodes(show_missed_tags=options['show_missed_tags'], overlap=options['overlap'], draw=options['draw_nodes']) diff --git a/ui.py b/ui.py index 1a6b6de..6fe3ebd 100644 --- a/ui.py +++ b/ui.py @@ -29,6 +29,8 @@ def parse_options(args): options['draw_ways'] = False elif arg in ['--show-missed-tags']: options['show_missed_tags'] = True + elif arg in ['--no-show-missed-tags']: + options['show_missed_tags'] = False elif arg in ['--overlap']: options['overlap'] = int(next(args)) else: