File size: 3,058 Bytes
1d0559b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import streamlit as st


from prettymaps import plot

x = st.slider("Select a value")
st.write(x, "squared is", x * x)


# import uuid

# # import typer
# # import vsketch
# from prettymaps import *
# import matplotlib.font_manager as fm
# from matplotlib import pyplot as plt


# def draw(
#     location: str = "Müvezzi Cd. No:15, Istanbul", radius: int = 1000, width: int = 12, height: int = 12
# ):
#     fig, ax = plt.subplots(figsize=(width, height), constrained_layout=True)

#     backup = plot(
#         location,
#         radius=radius,
#         ax=ax,
#         layers={
#             # Perimeter (in this case, a circle)
#             "perimeter": {},
#             # Streets and their widths
#             "streets": {
#                 "width": {
#                     "motorway": 5,
#                     "trunk": 5,
#                     "primary": 4.5,
#                     "secondary": 4,
#                     "tertiary": 3.5,
#                     "residential": 3,
#                     "service": 2,
#                     "unclassified": 2,
#                     "pedestrian": 2,
#                     "footway": 1,
#                 }
#             },
#             # Other layers:
#             #   Specify a name (for example, 'building') and which OpenStreetMap tags to fetch
#             "building": {"tags": {"building": True, "landuse": "construction"}, "union": False},
#             "water": {"tags": {"natural": ["water", "bay"]}},
#             "green": {"tags": {"landuse": "grass", "natural": ["island", "wood"], "leisure": "park"}},
#             "forest": {"tags": {"landuse": "forest"}},
#             "parking": {"tags": {"amenity": "parking", "highway": "pedestrian", "man_made": "pier"}},
#         },
#         # drawing_kwargs:
#         #   Reference a name previously defined in the 'layers' argument and specify matplotlib parameters to draw it
#         drawing_kwargs={
#             "background": {"fc": "#F2F4CB", "ec": "#dadbc1", "hatch": "ooo...", "zorder": -1},
#             "perimeter": {"fc": "#F2F4CB", "ec": "#dadbc1", "lw": 0, "hatch": "ooo...", "zorder": 0},
#             "green": {"fc": "#D0F1BF", "ec": "#2F3737", "lw": 1, "zorder": 1},
#             "forest": {"fc": "#64B96A", "ec": "#2F3737", "lw": 1, "zorder": 1},
#             "water": {
#                 "fc": "#a1e3ff",
#                 "ec": "#2F3737",
#                 "hatch": "ooo...",
#                 "hatch_c": "#85c9e6",
#                 "lw": 1,
#                 "zorder": 2,
#             },
#             "parking": {"fc": "#F2F4CB", "ec": "#2F3737", "lw": 1, "zorder": 3},
#             "streets": {"fc": "#2F3737", "ec": "#475657", "alpha": 1, "lw": 0, "zorder": 3},
#             "building": {
#                 "palette": ["#FFC857", "#E9724C", "#C5283D"],
#                 "ec": "#2F3737",
#                 "lw": 0.5,
#                 "zorder": 4,
#             },
#         },
#     )

#     filename = str(uuid.uuid4()).split("-")[0] + ".png"
#     plt.savefig(filename)
#     print(filename)


# draw()