notes on demand datasets, handling KMLs that define polygons

This commit is contained in:
Dustin Carlino 2019-05-09 11:17:49 -07:00
parent 994eb2dd73
commit 089b27fb83
2 changed files with 35 additions and 20 deletions

View File

@ -1,9 +1,5 @@
# Demand data
- https://en.wikipedia.org/wiki/Transportation_forecasting
- https://data.seattle.gov/Transportation/2016-Traffic-Flow-Counts/f22b-ywut
- counts per aterial
## Depicting
Axes:
@ -16,3 +12,29 @@ Fix a time, then show a bunch of directed arrows between neighborhood polygons.
Line thickness relative to number of trips. Color coding... if you're
interested in a particular neighborhood, vary all the line colors based on
src/dst.
## Sources
- https://en.wikipedia.org/wiki/Transportation_forecasting
- https://data.seattle.gov/Transportation/2016-Traffic-Flow-Counts/f22b-ywut
- counts per aterial
- high priority
https://gis-kingcounty.opendata.arcgis.com/datasets/acs-means-of-transportation-to-work-acs-b08301-transportation
https://gis-kingcounty.opendata.arcgis.com/datasets/acs-travel-time-to-work-acs-b08303-traveltime
https://gis-kingcounty.opendata.arcgis.com/datasets/consolidated-demographics-index-for-king-county-census-tracts-demographic-index-area
https://gis-kingcounty.opendata.arcgis.com/datasets/acs-household-size-by-vehicles-available-acs-b08201-householdvehicles
- indications of population
https://gis-kingcounty.opendata.arcgis.com/datasets/acs-total-population-acs-b01003-totalpop
https://gis-kingcounty.opendata.arcgis.com/datasets/acs-units-in-structure-acs-b25024-unitsinstructure
https://gis-kingcounty.opendata.arcgis.com/datasets/acs-household-type-including-living-alone-acs-b11001-householdtype
https://gis-kingcounty.opendata.arcgis.com/datasets/acs-housing-units-acs-b25001-housingunits
https://gis-kingcounty.opendata.arcgis.com/datasets/acs-occupancy-status-acs-b25002-occupancystatus
https://gis-kingcounty.opendata.arcgis.com/datasets/acs-household-size-by-number-of-workers-in-household-acs-b08202-householdworkers
- goldmine, but seemingly very hard to interpret
https://www.psrc.org/trip-based-travel-model-4k
https://www.psrc.org/activity-based-travel-model-soundcast

View File

@ -3,7 +3,7 @@ use crate::render::{
DrawCtx, DrawOptions, Renderable, EXTRA_SHAPE_POINT_RADIUS, EXTRA_SHAPE_THICKNESS,
};
use ezgui::{Color, GfxCtx};
use geom::{Circle, Distance, FindClosest, GPSBounds, PolyLine, Polygon, Pt2D};
use geom::{Circle, FindClosest, GPSBounds, PolyLine, Polygon, Pt2D};
use kml::ExtraShape;
use map_model::{DirectedRoadID, Map, LANE_THICKNESS};
use std::collections::BTreeMap;
@ -44,8 +44,14 @@ impl DrawExtraShape {
attributes: s.attributes,
road: None,
})
} else if pts[0] == *pts.last().unwrap() {
Some(DrawExtraShape {
id,
polygon: Polygon::new(&pts),
attributes: s.attributes,
road: None,
})
} else {
let width = get_sidewalk_width(&s.attributes).unwrap_or(EXTRA_SHAPE_THICKNESS);
let pl = PolyLine::new(pts);
// The blockface line endpoints will be close to other roads, so match based on the
// middle of the blockface.
@ -56,7 +62,7 @@ impl DrawExtraShape {
.map(|(r, _)| r);
Some(DrawExtraShape {
id,
polygon: pl.make_polygons(width),
polygon: pl.make_polygons(EXTRA_SHAPE_THICKNESS),
attributes: s.attributes,
road,
})
@ -84,16 +90,3 @@ impl Renderable for DrawExtraShape {
self.polygon.clone()
}
}
// See https://www.seattle.gov/Documents/Departments/SDOT/GIS/Sidewalks_OD.pdf
fn get_sidewalk_width(attribs: &BTreeMap<String, String>) -> Option<Distance> {
let base_width = attribs
.get("SW_WIDTH")
.and_then(|s| s.parse::<f64>().ok())
.map(Distance::inches)?;
let filler_width = attribs
.get("FILLERWID")
.and_then(|s| s.parse::<f64>().ok())
.map(Distance::inches)?;
Some(base_width + filler_width)
}