Visualizing Traffic Stress Data for Local Cyclists

Slides:



Advertisements
Similar presentations
GIS Tool in Drupal PNW Drupal Summit - Seattle October 20th, 2012 Mack Hardy & Tom
Advertisements

Visualizing maps on the web. What is a Map? A map is a drawing that is the representation, on a certain scale, of a terrain.
Tackling Sprawl and Transportation Issues Produced by Amanda Lawson Delaware Geographic Alliance – University of Delaware Funded by Space Grant.
IIS Technologies.
Carol Blackwood – Geo User Support Vivienne Mayo – User Support Digimap Roam webinar 12 th November 2014.
IBIS GIS Mapping Missouri “Show and Tell”. Outline 1.What is KML 2.Why we chose KML 3.Show and Tell.
Karsten Vennemann, Seattle Free and Easy Web Mapping.
U.S. Environmental Protection Agency WATERS Status Update
Best Practices for Designing Effective Map Services Tanu Hoque.
Chapter 14 Part II: Architectural Adaptation BY: AARON MCKAY.
MapTube and Streaming Google Earth – Sharing Data via Anonymous Servers Richard Milton and Andrew Hudson-Smith CASA, UCL UCL CENTRE FOR ADVANCED SPATIAL.
IT253: Computer Organization
Session: 1. © Aptech Ltd. 2Introduction to the Web / Session 1  Explain the evolution of HTML  Explain the page structure used by HTML  List the drawbacks.
© 2011 Autodesk Managing Your AutoCAD®/RealDWG® Model Memory Footprint for Better Performance Bill Adkison MarinCAD Software Engineering CP4286-U November.
Copyright 2007, Information Builders. Slide 1 Scaling Large HTML Reports With Active Cache Mark Nesson,Vashti Ragoonath June 2008.
The Metadata Tool Custom Metadata Tool Who this tool is for: This tool designed to be used a data management system. This tool is geared more for the.
HTML5 AND THE FUTURE JAVASCRIPT PLATFORM Marcelo Lopez Ruiz Senior Software Design Engineer Microsoft Corporation.
Quick overview of ASP.NET Ajax Ajax deep-dive Cover some key real-world problems Discuss solutions, patterns, opportunities Lots of demos And more of.
PERFORMANCE ENHANCEMENT IN ASP.NET By Hassan Tariq Session #1.
Types of Spatial Data Sites Data portals: Find and download data –Humboldt County, National Atlas “Atlases”: General information –GoogleMaps, MapQuest.
Road Ahead for Vector Mapping
Paperless Timesheet Management Project Anant Pednekar.
Mapping Like Google Edward Svirsky Presented by Mark Scheel.
® ® copyright © 2013 Open Geospatial Consortium What HTML5 and REST mean to the Geo community Raj Singh, PhD Open Geospatial Consortium
Open-Source JavaScript Maps with Leaflet Will Abson
GEOVISUALIZATION: VISUALIZE THAT ON A MAP Sarah G. Park April 14, 2016.
OpenLayers Prof. Wenwen Li School of Geographical Sciences and Urban Planning 5644 Coor Hall
IF STARBUCKS USED INSTART LOGIC, THEY WOULD HAVE A FASTER RESPONSIVE WEBSITE BY PETER BLUM.
GENERAL SCALABILITY CONSIDERATIONS
XHTML. What Is XHTML? XHTML stands for EXtensible HyperText Markup Language XHTML is almost identical to HTML XHTML is stricter than HTML XHTML is HTML.
Connected Infrastructure
Saving the King Street Bicycle Boulevard
ADVANCED: Making maps with Leaflet.js
Building Responsive Media for Optimal Performance
User working in web-browser
Need for Speed: Why Applications With No Database and No Services are Fast ARC334 Nick Randolph – Built to Roam.
Enhancing Web Map Performance in ArcGIS Online
Seattle Bike Map Update
Connected Infrastructure
Web App Builder and Me Ken Carrier – Senior GIS Specialist – City of Hamilton & Joe Guzi – GIS Systems Analyst – Stark County.
Developing an app for SharePoint autohosted in Azure
Build Better Apps with MEAN.
Tackling Sprawl and Transportation Issues
Introduction to SharePoint Framework (SPFx)
Tips for Website Speed Optimization
ADVANCED: Making maps with Leaflet.js Part II
Mapbox Studio Sarah and Haley.
Microsoft Ignite /20/2018 2:21 PM
Introduction to SharePoint Framework (SPFx)
jQuery The Easy JavaScript Nikolay Chochev Technical Trainer
City of Wilmington Bike Plan Update
Introduction to SharePoint Framework
An Intro to Leaflet.js Matt Anderson.
Introduction To Leaflet.js
Types of Spatial Data Sites
The SharePoint framework
To Be Safe For Now: Keep your shapefiles simple
MORE ON ARCHITECTURES The main reasons for using an architecture are maintainability and performance. We want to structure the software into reasonably.
Types of Spatial Data Sites
RESTful Web Services.
An introduction to jQuery
Build /19/2019 © 2015 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION.
Types of Spatial Data Sites
An introduction to jQuery
Build Micro Service landscape with Azure Functions
Yale Digital Conference 2019
Designing and Using Cached Map Services
Blazor A new framework for browser-based .NET apps Ryan Nowak
ArcGIS Pro: An Introduction Overview
LEVERAGING VECTOR TILE LAYERS IN WEB APPS
Presentation transcript:

Visualizing Traffic Stress Data for Local Cyclists LTS Dayton Visualizing Traffic Stress Data for Local Cyclists Matt Anderson

Roadmap Hatching the idea Getting the data Building the app Plenty of trial and error Demo!

Bio Matt Anderson Detroit-area native, moved to Dayton in 2006 Software Engineer at Northrop Grumman Bicycle commuter

Adventure Summit 2016 Annual event celebrating spirit of outdoor adventure Session: Past, Present, and Future of Biking Miami Valley MVRPC Bike Plan Update 2015 Level of Traffic Stress (LTS) analysis

What is Level of Traffic Stress (LTS)? Created by Mineta Transportation Institute in San Jose, CA Used to measure the bike friendliness of a city Streets categorized into four different stress levels

What is Level of Traffic Stress (LTS)? LTS 1: bikeways and low-volume streets with speed limit <= 25 mph LTS 2: some striped bike lanes, protected lanes, cycle tracks LTS 3: roads with 30 mph+ speeds and/or four lanes LTS 4: most roads with 30 mph+ speeds and/or five or more lanes

Getting the Data Available, but not necessarily “open” Ask, offer to help Be flexible, patient

Getting the Data Four .kmz files Trails: 363 bytes(?) Moderate stress streets (LTS 3): 707 KB High stress streets (LTS 4): 3.2 MB Low stress streets (LTS 1): 12.9 MB Extracted to .kml Trails: 491 bytes(?) Moderate stress streets (LTS 3): 18.2 MB High stress streets (LTS 4): 67.3 MB Low stress streets (LTS 1): 100.8 MB

Convert to GeoJSON Open standard for representing geographic features based on JSON $ npm install -g togeojson $ togeojson input.kml > output.geo.json These files are really big 27.5 MB, 106.5 MB, and 211 MB Almost 350 MB total 

Giant description

Tiny geo-coordinates

Shed Some Weight Features have long descriptions Wrote small script to remove them Largest file (LTS 1): 211 MB -> 39.1 MB

Shed Some Weight Use geojson-minifier to reduce precision $ npm install -g geojson-minifier $ geojson-minifier -o pack -f geo.json -p 6 $ geojson-minifier -o unpack -f geo.json.packed -p 6 39.1 MB -> 25.6 MB

Shed Some Weight Use TopoJSON – extends GeoJSON, typically 80% smaller $ npm install -g topojson $ topojson input.geo.json > output.topo.json 25.6 MB -> 5.1 MB Now we’re getting somewhere!

Spoiler Upon further review… $ topojson input.211mb.geo.json > output.5mb.topo.json

The App Leaflet.js + OpenStreetMap for mapping Npm for additional project structure*/dependencies Express.js to host app and serve files locally body-parser for JSON, and compression for gzip $ npm install express body-parser compression –-save

Let’s Try It Add a GeoJSON layer with Leaflet -> it works! function addGeoJsonToMap(url) { $.get(url, function(data) { L.geoJson(data).addTo(map); }); } Note: GeoJSON not TopoJSON

Let’s Try It Deploy to server to test performance NOT GOOD But not surprising, serving 25+ MB GeoJSON data

What Else? leaflet-omnivore lets us consume TopoJSON Reference from MapBox Plugins CDN TopoJSON is < 1 MB gzipped! function addTopoJsonToMap(url) { var layer = L.geoJson(null); omnivore.topojson(url, null, layer).addTo(map); }

What Else? Pan/zoom feels sluggish We are rendering LOTS of lines (svg) Any other ideas?

Slice and Dice geojson-vt – slice GeoJSON into tiles on the fly Draws lines using canvas element Used by MapBox GL, light on details Found a gist: https://gist.github.com/Sumbera/c67e5551b21c68dc8299

Slice and Dice function addGeoJsonVtToMap(url, lineColor) { $.get(url, function(data) { var tileIndex = geojsonvt(data, { maxZoom: 18 }); var canvasTiles = L.tileLayer.canvas(); canvasTiles.drawTile = function(canvas, tilePoint, zoom) { var tile = tileIndex.getTile(zoom, tilePoint.x, tilePoint.y); drawFeatures(canvas.getContext('2d'), tile.features, lineColor); }; canvasTiles.addTo(map); }); }

Slice and Dice Browser responsiveness much improved! Does not support TopoJSON 

Combine and Stir Let’s take the best of both worlds! Serve TopoJSON Convert to GeoJSON using TopoJSON client API

Combine and Stir function addTopoJsonToGeoJsonVtToMap(url, lineColor, objectKey) { $.get(url, function(data) { var geoJsonFeatColl = topojson.feature(data, data.objects[objectKey]) var tileIndex = geojsonvt(geoJsonFeatColl, { maxZoom: 18 }); var canvasTiles = L.tileLayer.canvas(); canvasTiles.drawTile = function(canvas, tilePoint, zoom) { var tile = tileIndex.getTile(zoom, tilePoint.x, tilePoint.y); drawFeatures(canvas.getContext('2d'), tile.features, lineColor); }; canvasTiles.addTo(map); }); }

Combine and Stir Serve < 1 MB of geo data! One small downside – lines not perfectly smooth

Go Faster IIS on Azure is really slow 15-20 second page loads for 1.2 MB of JSON Bump up service tier? CDN? Use Express! TopoJSON gzips to 739 KB Page loads in 2-3 seconds

Demo Time! http://ltsdayton.azurewebsites.net

Recap Cliché, but find some data that interests you Plenty of data available, might have to ask Keep experimenting (e.g. Express vs. IIS) Put it out there

Questions? LTS Dayton: https://github.com/mattbanderson/lts-dayton Intro to Leaflet (starts at 26:38): https://livestream.com/accounts/12766112/events/5328224