Bridges¶
satprint.bridges
¶
OpenStreetMap bridges over water -> closed solids: a raised deck.
OpenStreetMap has no deck heights, so they are estimated from the banks. The part of a bridge over water becomes a deck whose height blends the heights of the landings on its banks, lifted where needed to clear the water, and the deck is held up by thin piers at even spacing. A short landing on each bank is flat at the highest ground under it. Land approaches beyond the landing are left out, and so are bridges that cross no water.
Both pieces come from the transportation layer of the OpenFreeMap vector
tiles the buildings use: man_made=bridge outlines (class bridge) and
road, rail and path lines with brunnel bridge, drawn as strips of a
width per class (:data:BRIDGE_WIDTH_M).
Every solid is closed and outward-wound on its own and touches its
neighbors only along shared vertical faces, as in :mod:satprint.buildings.
bridge_mesh(outlines, lines, water, bbox, relief_mm, width_mm, depth_mm, base_mm, mm_per_m, sink_mm=0.3, min_width_mm=0.8, min_height_mm=0.2, clearance_mm=1.0, deck_mm=0.6, pier_spacing_mm=20.0, pier_mm=1.0, landing_m=30.0, min_landing_mm=1.0, ease_mm=3.0, min_area_mm2=0.2)
¶
Bridges over water as solids on the terrain block built from
relief_mm.
The footprint is the union of the outlines and the lines, each buffered
to its class width. Connected parts that cross water are cut to the
water plus a short landing on each bank. On each bank piece the deck is
flat at the highest ground under it plus min_height_mm. Over the
water its height blends those by distance to each bank piece, and is
lifted to clearance_mm above the water, the lift easing in over
ease_mm from the banks. The span is cut across the bridge's long
axis into thin piers, from below the ground up to the deck, and deck
slabs between them, open underneath. Land between stretches of water,
such as a tower's island, is part of the span, not a landing. With one
bank the deck is flat there, with none it is at the water plus the
clearance and stands on at least one pier, whatever pier_spacing_mm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
outlines
|
list[Polygon]
|
bridge outline polygons in lon/lat. |
required |
lines
|
list[tuple[LineString, str]]
|
(bridge line in lon/lat, OpenMapTiles class) pairs. |
required |
water
|
list[Polygon]
|
water polygons in lon/lat. |
required |
bbox
|
BBox
|
area the terrain block covers. |
required |
relief_mm
|
ndarray
|
the relief passed to :func: |
required |
width_mm
|
float
|
block width. |
required |
depth_mm
|
float
|
block depth. |
required |
base_mm
|
float
|
base thickness under the lowest terrain. |
required |
mm_per_m
|
float
|
horizontal model scale. |
required |
sink_mm
|
float
|
how far landings and piers go below the terrain. |
0.3
|
min_width_mm
|
float
|
narrowest a line's deck is drawn. |
0.8
|
min_height_mm
|
float
|
height of a landing above the highest ground under it. |
0.2
|
clearance_mm
|
float
|
least height of the deck top above the water. |
1.0
|
deck_mm
|
float
|
thickness of a deck slab. |
0.6
|
pier_spacing_mm
|
float
|
longest distance between piers; 0 for no piers. |
20.0
|
pier_mm
|
float
|
pier thickness along the bridge. |
1.0
|
landing_m
|
float
|
how far the bridge continues onto each bank. |
30.0
|
min_landing_mm
|
float
|
shortest landing, so small models keep one. |
1.0
|
ease_mm
|
float
|
distance from a bank over which the lift reaches full. |
3.0
|
min_area_mm2
|
float
|
pieces smaller than this are dropped, and a bridge must cross at least this much water. |
0.2
|
Returns:
| Type | Description |
|---|---|
BuildingMesh
|
all bridges as one :class: |
Source code in satprint/bridges.py
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | |
bridges_from_vector_tiles(tiles)
¶
Bridge outlines and lines, in lon/lat, from the tiles' transportation
layer.
Returns:
| Type | Description |
|---|---|
tuple[list[Polygon], list[tuple[LineString, str]]]
|
(outline polygons, (line, class) pairs). |
Source code in satprint/bridges.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | |