mirror of
https://github.com/enzet/map-machine.git
synced 2025-05-02 11:46:41 +02:00
Map and icon grid preview; new icons.
This commit is contained in:
parent
1c2b75d1e7
commit
fffacdba12
8 changed files with 696 additions and 352 deletions
1
.gitattributes
vendored
1
.gitattributes
vendored
|
@ -1,2 +1,3 @@
|
|||
*.md -diff
|
||||
*.png -diff
|
||||
*.svg -diff
|
||||
|
|
19
README.md
19
README.md
|
@ -3,7 +3,9 @@ Map generation
|
|||
|
||||
**Requirements**: Python 2.7.
|
||||
|
||||
python mapper.py -i <input OSM XML file name> -o <output SVG file name>
|
||||
python mapper.py -i <input OSM XML file name> -o <output SVG file name>
|
||||
|
||||

|
||||
|
||||
### Options ###
|
||||
|
||||
|
@ -11,11 +13,22 @@ Map generation
|
|||
|
||||
<table><tr><td><tt>-bbox</tt>, <tt>--boundary-box</tt>
|
||||
|
||||
</td><td><tt><longitude 1>,<longitude 2>,<latitude 1>,<latitude 2></tt>
|
||||
|
||||
</td><td>Boundary box to draw
|
||||
|
||||
</td></tr><tr><td><tt>--show-missed-tags</tt>
|
||||
</td></tr><tr><td><tt>-s</tt>, <tt>--size</tt>
|
||||
|
||||
</td><td>Show not drawed tags as text
|
||||
</td><td><tt><x>,<y></tt>
|
||||
|
||||
</td><td>Result image size
|
||||
|
||||
</td></tr></table>
|
||||
|
||||
Icons
|
||||
-----
|
||||
|
||||
Double size:
|
||||
|
||||

|
||||
|
||||
|
|
|
@ -3,12 +3,28 @@
|
|||
\b {Requirements}: Python 2.7.
|
||||
|
||||
\code
|
||||
{python mapper.py -i \formal {input OSM XML file name} -o \formal {output SVG file name} }
|
||||
{python mapper.py -i \formal {input OSM XML file name} -o \formal {output SVG file name}}
|
||||
|
||||
\image {https://raw.github.com/enzet/OSM/master/map.png} {Sample map}
|
||||
|
||||
\3 {Options}
|
||||
|
||||
\table
|
||||
{
|
||||
{{\tt {-bbox}, \tt {--boundary-box}} {Boundary box to draw}}
|
||||
{{\tt {--show-missed-tags}} {Show not drawed tags as text}}
|
||||
{
|
||||
{\tt {-bbox}, \tt {--boundary-box}}
|
||||
{\tt {\formal {longitude 1},\formal {longitude 2},\formal {latitude 1},\formal {latitude 2}}}
|
||||
{Boundary box to draw}
|
||||
}
|
||||
{
|
||||
{\tt {-s}, \tt {--size}}
|
||||
{\tt {\formal {x},\formal {y}}}
|
||||
{Result image size}
|
||||
}
|
||||
}
|
||||
|
||||
\2 {Icons}
|
||||
|
||||
Double size:
|
||||
|
||||
\image {https://raw.github.com/enzet/OSM/master/grid.png} {Icons}
|
||||
|
|
BIN
grid.png
Normal file
BIN
grid.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
953
icons.svg
953
icons.svg
File diff suppressed because it is too large
Load diff
Before Width: | Height: | Size: 156 KiB After Width: | Height: | Size: 182 KiB |
BIN
map.png
Normal file
BIN
map.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 112 KiB |
|
@ -43,7 +43,7 @@ water_border_color = '6688BB'
|
|||
wood_color = 'B8CC84'
|
||||
|
||||
tags_to_write = set(['operator', 'opening_hours', 'cuisine', 'network',
|
||||
'website', 'website_2', 'STIF:zone',
|
||||
'website', 'website_2', 'STIF:zone', 'opening_hours:url',
|
||||
'phone', 'branch', 'route_ref', 'brand', 'ref', 'wikipedia',
|
||||
'description', 'level', 'wikidata', 'name', 'alt_name',
|
||||
'image', 'fax', 'old_name', 'artist_name', 'int_name',
|
||||
|
@ -82,7 +82,7 @@ def get_d_from_file(file_name):
|
|||
if path:
|
||||
return path, x, y
|
||||
else:
|
||||
# print 'No such icon: ' + file_name
|
||||
print 'No such icon: ' + file_name
|
||||
# TODO: add to missed icons
|
||||
return 'M 4,4 L 4,10 10,10 10,4 z', 0, 0
|
||||
|
||||
|
@ -661,8 +661,8 @@ draw_nodes(show_missed_tags=options['show_missed_tags'],
|
|||
overlap=options['overlap'], draw=options['draw_nodes'])
|
||||
|
||||
if flinger.space.x == 0:
|
||||
output_file.rect(0, 0, w, flinger.space.y, color='FFFFFF')
|
||||
output_file.rect(0, h - flinger.space.y, w, flinger.space.y, color='FFFFFF')
|
||||
output_file.rect(0, 0, w, flinger.space.y, color='AAAAAA')
|
||||
output_file.rect(0, h - flinger.space.y, w, flinger.space.y, color='AAAAAA')
|
||||
|
||||
output_file.end()
|
||||
|
||||
|
|
45
tags.yml
45
tags.yml
|
@ -55,16 +55,21 @@ tags:
|
|||
icon: [bicycle_parking]
|
||||
- tags: {amenity: cafe}
|
||||
icon: [cafe]
|
||||
- tags: {amenity: nightclub}
|
||||
icon: [night_club]
|
||||
- tags: {amenity: waste_basket}
|
||||
icon: [waste_basket]
|
||||
- tags: {amenity: clinic}
|
||||
icon: [clinic]
|
||||
- tags: {amenity: restaurant}
|
||||
icon: [restaurant]
|
||||
- tags: {amenity: restaurant;bar}
|
||||
icon: [restaurant]
|
||||
add_icon: [bar]
|
||||
- tags: {amenity: pharmacy}
|
||||
icon: [pharmacy]
|
||||
- tags: {amenity: post_box}
|
||||
icon: [post_box]
|
||||
icon: [letter]
|
||||
- tags: {amenity: drinking_water}
|
||||
icon: [drinking_water]
|
||||
- tags: {amenity: toilets}
|
||||
|
@ -76,21 +81,31 @@ tags:
|
|||
- tags: {amenity: bar}
|
||||
icon: [bar]
|
||||
- tags: {amenity: bank}
|
||||
icon: [bank]
|
||||
icon: [money]
|
||||
- tags: {amenity: pub}
|
||||
icon: [pub]
|
||||
icon: [beer]
|
||||
- tags: {amenity: kindergarten}
|
||||
icon: [kindergarten]
|
||||
- tags: {amenity: post_office}
|
||||
icon: [post_office]
|
||||
icon: [letter]
|
||||
- tags: {amenity: fast_food}
|
||||
icon: [fast_food]
|
||||
- tags: {amenity: fountain}
|
||||
icon: [fountain]
|
||||
color: water_border
|
||||
- tags: {amenity: '*', karaoke: 'yes'}
|
||||
add_icon: [microphone]
|
||||
|
||||
# Shop
|
||||
|
||||
- tags: {amenity: shop, shop: fishing}
|
||||
icon: [fishing]
|
||||
- tags: {shop: clothes}
|
||||
icon: [shop_clothes]
|
||||
- tags: {amenity: shop, shop: clothes}
|
||||
icon: [clothes]
|
||||
- tags: {shop: bakery}
|
||||
icon: [cupcake]
|
||||
- tags: {shop: convenience}
|
||||
icon: [shop_convenience]
|
||||
- tags: {amenity: shop, shop: convenience}
|
||||
|
@ -103,11 +118,9 @@ tags:
|
|||
icon: [kiosk]
|
||||
- tags: {shop: gift}
|
||||
icon: [gift]
|
||||
- tags: {amenity: fountain}
|
||||
icon: [fountain]
|
||||
color: water_border
|
||||
- tags: {amenity: '*', karaoke: 'yes'}
|
||||
add_icon: [microphone]
|
||||
|
||||
# Place of worship
|
||||
|
||||
- tags: {amenity: place_of_worship, religion: christian}
|
||||
icon: [christian]
|
||||
- tags: {amenity: place_of_worship, religion: muslim}
|
||||
|
@ -159,14 +172,14 @@ tags:
|
|||
|
||||
- tags: {highway: bus_stop}
|
||||
icon: [bus_stop]
|
||||
add_icon: [bus]
|
||||
- tags: {highway: bus_stop, shelter: 'yes'}
|
||||
icon: [bus_stop_with_shelter]
|
||||
icon: [bus_stop_sign]
|
||||
under_icon: [bus_stop_sign]
|
||||
over_icon: [bus_stop_shelter]
|
||||
- tags: {highway: bus_stop, bench: 'yes'}
|
||||
icon: [bus_stop_with_bench]
|
||||
- tags: {highway: bus_stop, bench: 'yes', shelter: 'no'}
|
||||
icon: [bus_stop_with_bench]
|
||||
- tags: {highway: bus_stop, shelter: 'yes', bench: 'yes'}
|
||||
icon: [bus_stop_with_shelter_and_bench]
|
||||
under_icon: [bus_stop_sign]
|
||||
over_icon: [bus_stop_bench]
|
||||
- tags: {highway: crossing}
|
||||
icon: [crossing]
|
||||
- tags: {highway: crossing, crossing: zebra}
|
||||
|
@ -232,7 +245,7 @@ tags:
|
|||
- tags: {amenity: atm}
|
||||
icon: [atm]
|
||||
- tags: {public_transport: stop_position}
|
||||
icon: [public_transport_stop]
|
||||
icon: [bus_stop]
|
||||
- tags: {crossing_ref: toucan}
|
||||
icon: [toucan_crossing]
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue