Skip to content

Commit

Permalink
Enlarge Stapleford boundary, and add more of Bristol. [rebuild] [rele…
Browse files Browse the repository at this point in the history
…ase]

Dance around maxspeed=0 errors too (fixed upstream in
https://www.openstreetmap.org/changeset/126591589)
  • Loading branch information
dabreegster committed Jan 25, 2023
1 parent f9ab860 commit 3e4afd9
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 129 deletions.
28 changes: 19 additions & 9 deletions data/MANIFEST.json
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,11 @@
"uncompressed_size_bytes": 20006535,
"compressed_size_bytes": 5820190
},
"data/input/gb/bristol/raw_maps/huge.bin": {
"checksum": "6f373c2eb85b8de2fc27056bd0f52524",
"uncompressed_size_bytes": 82201210,
"compressed_size_bytes": 25842958
},
"data/input/gb/burnley/osm/lancashire-latest.osm.pbf": {
"checksum": "6a7520bfa839e28a147b020cc0b59bb1",
"uncompressed_size_bytes": 35851949,
Expand Down Expand Up @@ -1171,9 +1176,9 @@
"compressed_size_bytes": 36319627
},
"data/input/gb/nottingham/raw_maps/stapleford.bin": {
"checksum": "9effb7bda1448ac8487a90c113dab9d0",
"uncompressed_size_bytes": 6156175,
"compressed_size_bytes": 1542056
"checksum": "d2335f52cdba2a6efc88cf6409d4c05c",
"uncompressed_size_bytes": 11887730,
"compressed_size_bytes": 3177125
},
"data/input/gb/oxford/osm/oxfordshire-latest.osm.pbf": {
"checksum": "5b8b146ec36f7743def6e9051b1dc72e",
Expand Down Expand Up @@ -2540,6 +2545,11 @@
"uncompressed_size_bytes": 31598067,
"compressed_size_bytes": 12272492
},
"data/system/gb/bristol/maps/huge.bin": {
"checksum": "c2bd09ceb13d2689328eb316b4f4070a",
"uncompressed_size_bytes": 139721750,
"compressed_size_bytes": 55935122
},
"data/system/gb/bristol/scenarios/east/background.bin": {
"checksum": "323e36f6cf2bddb73897280d3d8a0a13",
"uncompressed_size_bytes": 8547370,
Expand Down Expand Up @@ -3696,9 +3706,9 @@
"compressed_size_bytes": 74432005
},
"data/system/gb/nottingham/maps/stapleford.bin": {
"checksum": "b2d702e522f54e7ad86dd833c377bbfd",
"uncompressed_size_bytes": 7127105,
"compressed_size_bytes": 2706683
"checksum": "88375319bf0ee9896fc1629b3093705c",
"uncompressed_size_bytes": 14676251,
"compressed_size_bytes": 5576803
},
"data/system/gb/nottingham/scenarios/center/background.bin": {
"checksum": "15d01a3d28db4c02954dad26c04eb103",
Expand All @@ -3711,9 +3721,9 @@
"compressed_size_bytes": 5896052
},
"data/system/gb/nottingham/scenarios/stapleford/background.bin": {
"checksum": "4913b92b0df1e0022b75a0b986b91e77",
"uncompressed_size_bytes": 2772286,
"compressed_size_bytes": 594768
"checksum": "69e23708ec26dbb2914bc64b5d56432d",
"uncompressed_size_bytes": 4256476,
"compressed_size_bytes": 1068103
},
"data/system/gb/oxford/maps/center.bin": {
"checksum": "b1075cef219af51afc401bbddca8b6d2",
Expand Down
44 changes: 44 additions & 0 deletions importer/config/gb/bristol/huge.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"coordinates": [
[
[
-2.67498660865445,
51.545979673849814
],
[
-2.725072320187934,
51.50533419979146
],
[
-2.639211100415366,
51.4555425006248
],
[
-2.6398332831680023,
51.396186531571374
],
[
-2.5247294740525206,
51.396768827096
],
[
-2.5026419863566787,
51.49507032185082
],
[
-2.67498660865445,
51.545979673849814
]
]
],
"type": "Polygon"
}
}
]
}
124 changes: 14 additions & 110 deletions importer/config/gb/nottingham/stapleford.geojson
Original file line number Diff line number Diff line change
Expand Up @@ -8,128 +8,32 @@
"coordinates": [
[
[
-1.2649320275953357,
52.920091954516806
-1.2433760624927004,
52.95625455024799
],
[
-1.2622562563127246,
52.921858864033794
-1.2795962053782262,
52.957969792170786
],
[
-1.2553757015852511,
52.92930981963164
-1.304849872940025,
52.92764439348608
],
[
-1.2493870706194343,
52.93522358273418
-1.3041125032194145,
52.896553787906385
],
[
-1.2482403114977956,
52.93668269869178
-1.2520888248888298,
52.89908428093173
],
[
-1.2519354242214717,
52.93722025532773
-1.2405764961728778,
52.94648564112964
],
[
-1.2580514728678622,
52.940982964809734
],
[
-1.2546111955041113,
52.9432097203796
],
[
-1.2495144883000648,
52.94881449432094
],
[
-1.2495144883000648,
52.949966070266214
],
[
-1.2560127899857036,
52.94858417545316
],
[
-1.2621288386320941,
52.9463576965033
],
[
-1.2649320275953357,
52.94658802722586
],
[
-1.2669707104774375,
52.94520602449316
],
[
-1.271430329281003,
52.94466856706262
],
[
-1.2771641248868093,
52.942518670570536
],
[
-1.2813689083316717,
52.94129011032254
],
[
-1.2807318199311624,
52.9396007830201
],
[
-1.27933022544957,
52.938679303964705
],
[
-1.2792028077689679,
52.93768101284354
],
[
-1.278310884008505,
52.93560756538747
],
[
-1.2780560486485513,
52.93368761805078
],
[
-1.2804769845699866,
52.93099954868373
],
[
-1.281878579051579,
52.92884897298771
],
[
-1.2850640210553763,
52.9264678538315
],
[
-1.2859559448158393,
52.925853350207404
],
[
-1.2849366033748026,
52.92431705298574
],
[
-1.2836624265737555,
52.922857520127934
],
[
-1.2828979204926156,
52.92132111659606
],
[
-1.2828979204926156,
52.919246885347235
],
[
-1.2649320275953357,
52.920091954516806
-1.2433760624927004,
52.95625455024799
]
]
],
Expand Down
22 changes: 12 additions & 10 deletions map_model/src/objects/road.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,19 +233,21 @@ impl Road {

pub(crate) fn speed_limit_from_osm(&self) -> Speed {
if let Some(limit) = self.osm_tags.get("maxspeed") {
if let Ok(kmph) = limit.parse::<f64>() {
if kmph == 0.0 {
warn!("{} has a speed limit of 0", self.orig_id.osm_way_id);
return Speed::miles_per_hour(1.0);
}
return Speed::km_per_hour(kmph);
}

if let Some(mph) = limit
if let Some(speed) = if let Ok(kmph) = limit.parse::<f64>() {
Some(Speed::km_per_hour(kmph))
} else if let Some(mph) = limit
.strip_suffix(" mph")
.and_then(|x| x.parse::<f64>().ok())
{
return Speed::miles_per_hour(mph);
Some(Speed::miles_per_hour(mph))
} else {
None
} {
if speed == Speed::ZERO {
warn!("{} has a speed limit of 0", self.orig_id.osm_way_id);
return Speed::miles_per_hour(1.0);
}
return speed;
}

// TODO Handle implicits, like PL:zone30
Expand Down

0 comments on commit 3e4afd9

Please sign in to comment.