get rid of the coordinates_in_world_space hack; synthetic can just directly work in Pt2Ds now

This commit is contained in:
Dustin Carlino 2019-08-26 15:56:22 -07:00
parent a5fc3b092f
commit 0a39f4bd77
4 changed files with 0 additions and 25 deletions

View File

@ -74,9 +74,6 @@ pub struct GPSBounds {
pub(crate) min_lat: f64,
pub(crate) max_lon: f64,
pub(crate) max_lat: f64,
// TODO hack to easily construct test maps
pub represents_world_space: bool,
}
impl GPSBounds {
@ -86,7 +83,6 @@ impl GPSBounds {
min_lat: f64::MAX,
max_lon: f64::MIN,
max_lat: f64::MIN,
represents_world_space: false,
}
}

View File

@ -36,11 +36,6 @@ impl Pt2D {
}
pub fn from_gps(gps: LonLat, b: &GPSBounds) -> Option<Pt2D> {
// TODO hack to construct test maps more easily
if b.represents_world_space {
return Some(Pt2D::new(gps.longitude, gps.latitude));
}
if !b.contains(gps) {
return None;
}
@ -63,10 +58,6 @@ impl Pt2D {
// Can go out of bounds.
pub fn forcibly_to_gps(self, b: &GPSBounds) -> LonLat {
if b.represents_world_space {
return LonLat::new(self.x(), self.y());
}
let (width, height) = {
let pt = b.get_max_world_pt();
(pt.x(), pt.y())
@ -77,15 +68,6 @@ impl Pt2D {
}
pub fn to_gps(self, b: &GPSBounds) -> Option<LonLat> {
if b.represents_world_space {
let pt = LonLat::new(self.x(), self.y());
if b.contains(pt) {
return Some(pt);
} else {
return None;
}
}
let (width, height) = {
let pt = b.get_max_world_pt();
(pt.x(), pt.y())

View File

@ -36,7 +36,6 @@ pub struct Map {
pub boundary_polygon: Polygon,
pub gps_bounds: GPSBounds,
pub coordinates_in_world_space: bool,
}
impl Map {
@ -55,7 +54,6 @@ impl Map {
Distance::meters(1.0),
),
gps_bounds: GPSBounds::new(),
coordinates_in_world_space: false,
}
}

View File

@ -310,7 +310,6 @@ impl Model {
// Returns path to raw map
pub fn export(&self) -> String {
let mut map = raw_data::Map::blank();
map.coordinates_in_world_space = true;
fn gps(p: Pt2D) -> LonLat {
LonLat::new(p.x(), p.y())