mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-27 00:12:55 +03:00
defining a better set of pre-converted maps. disabling fix_ramps in most
cases.
This commit is contained in:
parent
88856c50ce
commit
a816a3d0be
11
data/polygons/ballard.poly
Normal file
11
data/polygons/ballard.poly
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
ballard
|
||||||
|
1
|
||||||
|
-122.4391556617474 47.68677491106829
|
||||||
|
-122.33336101886596 47.68699874951752
|
||||||
|
-122.32265304245747 47.678233451251096
|
||||||
|
-122.32613516242318 47.649706710073175
|
||||||
|
-122.3351522577316 47.640283190231
|
||||||
|
-122.39076418493912 47.65580662325181
|
||||||
|
-122.4391556617474 47.68677491106829
|
||||||
|
END
|
||||||
|
END
|
10
data/polygons/caphill.poly
Normal file
10
data/polygons/caphill.poly
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
caphill
|
||||||
|
1
|
||||||
|
-122.3218020058858 47.605453088643266
|
||||||
|
-122.33521557443338 47.630740654167774
|
||||||
|
-122.32098812636454 47.65727694392701
|
||||||
|
-122.28604060126838 47.64170146266838
|
||||||
|
-122.29277454107876 47.62125681322834
|
||||||
|
-122.3218020058858 47.605453088643266
|
||||||
|
END
|
||||||
|
END
|
10
data/polygons/downtown.poly
Normal file
10
data/polygons/downtown.poly
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
downtown
|
||||||
|
1
|
||||||
|
-122.37731058100624 47.630712473025994
|
||||||
|
-122.32103102008703 47.62926060822875
|
||||||
|
-122.30268854500471 47.61587802737301
|
||||||
|
-122.3144789819764 47.60421406269271
|
||||||
|
-122.35612703740053 47.60229914259757
|
||||||
|
-122.37731058100624 47.630712473025994
|
||||||
|
END
|
||||||
|
END
|
@ -1,9 +0,0 @@
|
|||||||
eastlake
|
|
||||||
1
|
|
||||||
-122.32318456203885 47.64781429884714
|
|
||||||
-122.31404025447819 47.64752419324615
|
|
||||||
-122.3143868920101 47.643513612626805
|
|
||||||
-122.3223800171668 47.642566447412605
|
|
||||||
-122.32318456203885 47.64781429884714
|
|
||||||
END
|
|
||||||
END
|
|
@ -1,10 +0,0 @@
|
|||||||
lakeslice
|
|
||||||
1
|
|
||||||
-122.28208483988134 47.609153677496806
|
|
||||||
-122.30280371368082 47.645038985773375
|
|
||||||
-122.30116630616125 47.6563791641864
|
|
||||||
-122.26787108070758 47.66417155122059
|
|
||||||
-122.26425580489284 47.66338616196675
|
|
||||||
-122.28208483988134 47.609153677496806
|
|
||||||
END
|
|
||||||
END
|
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## Boundary clipping
|
## Boundary clipping
|
||||||
|
|
||||||
- lakes missing from small_seattle
|
- lakes missing from huge_seattle
|
||||||
- just connecting the ends of ways doesnt always work well
|
- just connecting the ends of ways doesnt always work well
|
||||||
- maybe increase the Bounds for areas, and let clipping clean up later?
|
- maybe increase the Bounds for areas, and let clipping clean up later?
|
||||||
- some border intersections have weird OOBish geometry, or the arrows look weird
|
- some border intersections have weird OOBish geometry, or the arrows look weird
|
||||||
|
@ -120,6 +120,9 @@ impl Pt2D {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn center(pts: &Vec<Pt2D>) -> Pt2D {
|
pub fn center(pts: &Vec<Pt2D>) -> Pt2D {
|
||||||
|
if pts.is_empty() {
|
||||||
|
panic!("Can't find center of 0 points");
|
||||||
|
}
|
||||||
let mut x = 0.0;
|
let mut x = 0.0;
|
||||||
let mut y = 0.0;
|
let mut y = 0.0;
|
||||||
for pt in pts {
|
for pt in pts {
|
||||||
|
@ -6,9 +6,9 @@ use geom::Bounds;
|
|||||||
use std::collections::{BTreeSet, HashSet};
|
use std::collections::{BTreeSet, HashSet};
|
||||||
|
|
||||||
pub fn fix_ramps(m: &mut InitialMap, timer: &mut Timer) {
|
pub fn fix_ramps(m: &mut InitialMap, timer: &mut Timer) {
|
||||||
if m.name == "small_seattle" {
|
if m.name != "montlake" {
|
||||||
timer.warn(
|
timer.warn(
|
||||||
"fix_ramps still disabled for small_seattle; crosses_polygon seeing strange results"
|
"fix_ramps still disabled generally; crosses_polygon seeing strange results"
|
||||||
.to_string(),
|
.to_string(),
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
@ -124,6 +124,10 @@ fn fix_ramp(
|
|||||||
|
|
||||||
if let Some(last_road) = delete_roads.last() {
|
if let Some(last_road) = delete_roads.last() {
|
||||||
let mut i = m.intersections.get_mut(&last_normal_intersection).unwrap();
|
let mut i = m.intersections.get_mut(&last_normal_intersection).unwrap();
|
||||||
|
if i.roads.len() == 1 {
|
||||||
|
// Woops, can't do this.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
i.roads.remove(&last_road);
|
i.roads.remove(&last_road);
|
||||||
i.polygon = geometry::intersection_polygon(i, &mut m.roads, timer);
|
i.polygon = geometry::intersection_polygon(i, &mut m.roads, timer);
|
||||||
} else {
|
} else {
|
||||||
|
@ -13,6 +13,9 @@ pub fn intersection_polygon(
|
|||||||
roads: &mut BTreeMap<StableRoadID, Road>,
|
roads: &mut BTreeMap<StableRoadID, Road>,
|
||||||
timer: &mut Timer,
|
timer: &mut Timer,
|
||||||
) -> Vec<Pt2D> {
|
) -> Vec<Pt2D> {
|
||||||
|
if i.roads.is_empty() {
|
||||||
|
panic!("{} has no roads", i.id);
|
||||||
|
}
|
||||||
let mut road_endpts: Vec<Pt2D> = Vec::new();
|
let mut road_endpts: Vec<Pt2D> = Vec::new();
|
||||||
|
|
||||||
// Turn all of the incident roads into two PolyLines (the "forwards" and "backwards" borders of
|
// Turn all of the incident roads into two PolyLines (the "forwards" and "backwards" borders of
|
||||||
|
@ -14,7 +14,9 @@ mkdir $OUT
|
|||||||
cp color_scheme docs/INSTRUCTIONS.md release/play_abstreet.sh $OUT
|
cp color_scheme docs/INSTRUCTIONS.md release/play_abstreet.sh $OUT
|
||||||
|
|
||||||
mkdir -p $OUT/data/maps
|
mkdir -p $OUT/data/maps
|
||||||
cp -v data/maps/montlake.abst data/maps/23rd.abst $OUT/data/maps/
|
for map in 23rd ballard caphill downtown montlake; do
|
||||||
|
cp -v data/maps/$map.abst $OUT/data/maps/
|
||||||
|
done
|
||||||
|
|
||||||
mkdir $OUT/editor
|
mkdir $OUT/editor
|
||||||
cargo build --release --bin editor
|
cargo build --release --bin editor
|
||||||
|
@ -10,7 +10,9 @@ mkdir $OUT
|
|||||||
cp color_scheme docs/INSTRUCTIONS.md release/play_abstreet.bat $OUT
|
cp color_scheme docs/INSTRUCTIONS.md release/play_abstreet.bat $OUT
|
||||||
|
|
||||||
mkdir -p $OUT/data/maps
|
mkdir -p $OUT/data/maps
|
||||||
cp -v data/maps/montlake.abst data/maps/23rd.abst $OUT/data/maps/
|
for map in 23rd ballard caphill downtown montlake; do
|
||||||
|
cp -v data/maps/$map.abst $OUT/data/maps/
|
||||||
|
done
|
||||||
|
|
||||||
mkdir $OUT/editor
|
mkdir $OUT/editor
|
||||||
cross build --release --target x86_64-pc-windows-gnu --bin editor
|
cross build --release --target x86_64-pc-windows-gnu --bin editor
|
||||||
|
@ -59,9 +59,9 @@ pub fn run(t: &mut TestRunner) {
|
|||||||
|
|
||||||
t.run_slow("biggest_map_loads", |_| {
|
t.run_slow("biggest_map_loads", |_| {
|
||||||
map_model::Map::new(
|
map_model::Map::new(
|
||||||
"../data/raw_maps/small_seattle.abst",
|
"../data/raw_maps/huge_seattle.abst",
|
||||||
&mut abstutil::Timer::throwaway(),
|
&mut abstutil::Timer::throwaway(),
|
||||||
)
|
)
|
||||||
.expect("small_seattle broke");
|
.expect("huge_seattle broke");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user