-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
executable file
·66 lines (62 loc) · 2.1 KB
/
example.py
File metadata and controls
executable file
·66 lines (62 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import matplotlib.pyplot as plt
from osm_painter import draw, Layers, RadiusLocation
fig, ax = plt.subplots(figsize=(15, 12), constrained_layout=True)
draw(ax, RadiusLocation((38.54200, -1.95335), 750),
[
Layers.highway_layer,
Layers.building_layer,
Layers.landuse_layer,
Layers.waterway_layer,
Layers.leisure_layer,
Layers.elevation_layer,
Layers.water_layer
], style={
'highway': {
'primary': {'lw': 4.5, 'color': '#011627'},
'secondary': {'lw': 4, 'color': '#011627'},
'tertiary': {'lw': 3.5, 'color': '#011627'},
'residential': {'lw': 3, 'color': '#011627'},
'unclassified': {'lw': 3, 'color': '#011627'},
'path': {'lw': 1, 'color': '#011627'},
'track': {'lw': 1, 'color': '#011627'},
'footway': {'lw': 1, 'color': '#011627'},
},
'building': {
'default': {'fc': '#6B0504', 'ec': '#2F3737', 'lw': 0, 'zorder': 2},
},
'landuse': {
'cemetery': {'color': '#948e8e', 'lw': 1, 'zorder': -2},
'forest': {'color': '#80FF72', 'lw': 0, 'zorder': -2},
'grass': {'color': '#80FF72', 'lw': 0, 'zorder': -2}
},
'waterway': {
'river': {'color': '#20A4F3', 'lw': 4, 'zorder': -1},
'default': {'color': '#20A4F3', 'lw': 1, 'zorder': -1},
},
'water': {
'default': {'color': '#20A4F3', 'lw': 0, 'zorder': -1},
},
'leisure': {
'park': {'color': '#80FF72', 'lw': 0, 'zorder': -2}
},
'elevation': {
'default': {'color': plt.get_cmap('viridis'), 'lw': 2, 'zorder': -3}
},
'perimeter': {
'default': {
'lw': 2,
'fc': '#011627',
'zorder': 10
}
},
'background': {
'default': {
'zorder': -10,
'fc': '#F6F7F8',
'ec': '#E8EBED',
'hatch': 'ooo...'
}
}}
)
plt.savefig('out.svg')
plt.show()