forked from kauevestena/osm_sidewalkreator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
parameters.py
152 lines (105 loc) · 3.78 KB
/
parameters.py
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# -*- coding: utf-8 -*-
"""
File intended to store "hyperparameters"
ALL DISTANCES MUST BE IN METERS, no feets nor yards
"""
CRS_LATLON_4326 = "EPSG:4326"
# to look for adresses:
addr_tag = 'addr:housenumber'
highway_tag = 'highway'
sidewalk_tag_value = 'footway'
widths_fieldname = 'width'
# control
use_buildings = True
draw_buildings = True
# to control whether must download relations in buildings
include_relations = True
# buffer that defines the curvature radius is defined in GUI, max and min are in the .ui file
default_curve_radius = 3
# minimal distance that a sidewalk must be from a building
min_d_to_building = 1 # 1 m defined in gui, along with max an min allowed values at .ui file
osm_higway_layer_finalname = 'osm_clipped_highways'
buildings_layername = 'osm_buildings'
roads_layername = "osm_road_data"
# big buffer distance
big_buffer_d = 3000
# min buffer size for the worst case (building intersecting road)
minimal_buffer = 3 # 2m
# distance to add to distance to interpolate inner_points, should be a small distance, 0.5 or 1 m, generally
d_to_add_interp_d = 2
# percent of middle-crossing segment to draw Kerbs
perc_draw_kerbs = 30
# percent of tolerance to drive a point innerly in segment
perc_tol_crossings = 25
# percent of length to interpolate if passes half the length
perc_to_interpolate = 0.4
# distance to add to each side, as we are creating sidewalk axis, not kerbs
d_to_add_to_each_side = 1 # 1m
# for values that must be ignored one must use "0" as value
default_widths = {
# loosely based on https://www.gov.br/dnit/pt-br/rodovias/operacoes-rodoviarias/faixa-de-dominio/regulamentacao-atual/normas-para-o-projeto-das-estradas-de-rodagem (Brazilian DNIT specifications)
# most common:
'motorway' : 22.0,
'trunk' : 18.0,
'primary' : 12.0,
'residential': 6.0,
'secondary' : 10.0,
'tertiary' : 8.0,
'unclassified': 4.0,
# unclear/uncanny/rare cases:
'road' : 6.0,
'living_street': 0.0,
# values that must be ignored:
'sidewalk' : 0,
'crossing' : 0,
'path' : 0,
'service' : 0,
'pedestrian' : 0,
'escape' : 0,
'raceway' : 0,
'cycleway' : 0,
'proposed' :0,
'construction' : 0,
'platform' : 0,
'services' : 0,
'footway' : 0,
'track' : 0,
"tertiary_link" : 0,
"trunk_link" : 0,
"primary_link" : 0,
'corridor' : 0 ,
'steps' : 0,
'street_lamp' : 0,
'motorway_link' : 0,
'secondary_link' : 0,
# '' : ,
}
# ASSETS:
# names of the assets filenames:
sidewalks_stylefilename = 'sidewalkstyles.qml'
inputpolygons_stylefilename = 'polygonstyles.qml'
crossings_stylefilename = 'crossings.qml'
kerbs_stylefilename = 'kerbs.qml'
osm_basemap_str = "crs=EPSG:3857&format&type=xyz&url=http://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png&zmax=19&zmin=0"
bing_baseimg_str = 'crs=EPSG:3857&format&type=xyz&url=http://ak.t0.tiles.virtualearth.net/tiles/a%7Bq%7D.jpeg?n%3Dz%26g%3D5880&zmax=19&zmin=0'
crossing_centers_layername = 'crossing_points'
crossings_layer_name = 'CROSSINGS'
kerbs_layer_name = 'KERBS'
# little buffer for dissolved protoblocks "within" condition eligibility in all cases (as long as I know)
protoblocks_buffer = 0.5 # 50 cm
# value to exclude "tiny segments"
tiny_segments_tol = 0.1
# (draw_crossings context) increment in meters if the length of the crossing is bigger than the max len
increment_inward = 0.5
# max iterations in the
max_crossings_iterations = 20
# max distance for distance search in knn
knn_max_dist = 50
# cutoff percent to say that a protoblock contains an already drawn sidewalk:
cutoff_percent_protoblock = 40
# for duplicate points (m):
duplicate_points_tol = .1
# snap tolerance for disjointed (m):
snap_disjointed_tol = .5
# minimum length that a sidewalk stretch should have (m):
min_stretch_size = 7