mirror of
https://github.com/enzet/map-machine.git
synced 2025-05-21 21:16:24 +02:00
Readme added.
This commit is contained in:
parent
128ad8f8e8
commit
e408d537ee
4 changed files with 40 additions and 3 deletions
21
README.md
Normal file
21
README.md
Normal file
|
@ -0,0 +1,21 @@
|
|||
Map generation
|
||||
--------------
|
||||
|
||||
**Requirements**: Python 2.7.
|
||||
|
||||
python mapper.py -i <input OSM XML file name> -o <output SVG file name>
|
||||
|
||||
### Options ###
|
||||
|
||||
|
||||
|
||||
<table><tr><td><tt>-bbox</tt>, <tt>--boundary-box</tt>
|
||||
|
||||
</td><td>Boundary box to draw
|
||||
|
||||
</td></tr><tr><td><tt>--show-missed-tags</tt>
|
||||
|
||||
</td><td>Show not drawed tags as text
|
||||
|
||||
</td></tr></table>
|
||||
|
14
doc/readme.moi
Normal file
14
doc/readme.moi
Normal file
|
@ -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}}
|
||||
}
|
|
@ -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'])
|
||||
|
||||
|
|
2
ui.py
2
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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue