Bu

109
Building Location-Aware Apps with Open Source & Open Data #openmaps Matthew Smollinger @mattsmollinger Chuck Greb @ecgreb SXSW Interactive | 14 March 2015

Transcript of Bu

Page 1: Bu

Building Location-Aware Appswith Open Source & Open Data

#openmaps

Matthew Smollinger@mattsmollinger

Chuck Greb@ecgreb

SXSW Interactive | 14 March 2015

Page 2: Bu

Mapzen is an open source mapping lab building and supporting open data and software to promote a healthy mapping

ecosystem.

Page 3: Bu

Skaffl is an EdTech company that specializes in mobile solutions for the K-12

market.

Page 4: Bu

start where you are

Page 5: Bu

Part 1: Overview

⇢ Location-aware apps

⇢ Open source and open data

Part 2: Maps

⇢ Raster tiles

⇢ Vector tiles

Part 3: Geolocation, Search & Routing

⇢ Location services

⇢ Geocoding

⇢ Navigation

Part 4: Beacons & BLE

⇢ Monitoring and ranging

⇢ Indoor positioning

Agenda

Page 6: Bu

#openmaps

Part 1:Overview

Page 7: Bu

Building Location-Aware Appswith Open Source & Open Data

#openmaps

Page 8: Bu

3 kinds of location-aware apps

⇢ Mapping applications

⇢ Location-based apps

⇢ Apps with location-aware features

Location-Aware Apps

Page 9: Bu

Mapping applications

Page 10: Bu
Page 11: Bu
Page 12: Bu
Page 13: Bu

Location-based apps

Page 14: Bu
Page 15: Bu
Page 16: Bu
Page 17: Bu

Wearable integration

Page 18: Bu

Apps with location-aware features

Page 19: Bu
Page 20: Bu
Page 21: Bu

Common features

⇢ Maps

⇢ Geolocation

⇢ Search

⇢ Navigation

Location-Aware Apps

Page 22: Bu

Building Location-Aware Appswith Open Source & Open Data

Page 23: Bu

Code

Open Source

Page 24: Bu

Philosophy

Open Source

Page 25: Bu

License

Open Source

Page 26: Bu

Community

Open Source

Page 27: Bu

Advantages

⇢ Transparency

⇢ Flexibility

⇢ Compatibility

⇢ Free!

Location-Aware Apps

Page 28: Bu

Open source is not free like beer

Open Source

Page 29: Bu

Open source is free like a puppy

Open Source

Page 30: Bu

Building Location-Aware Appswith Open Source & Open Data

Page 31: Bu

Availability & Access

Open Data

Page 32: Bu

Reuse & Redistribution

Open Data

Page 33: Bu

Universal Participation

Open Data

Page 34: Bu

Open Knowledge Foundationhttps://okfn.org/

Open Data

Page 35: Bu

OpenStreetMap (OSM)

⇢ Crowdsourced & public data

⇢ Local knowledge

⇢ Attribution

⇢ Share-alike

Open Data

Page 36: Bu
Page 37: Bu

#openmaps

Part 2:Maps

Page 38: Bu

Datasource

Maps

Page 39: Bu

Tiles

Maps

Raster Vector

Page 40: Bu

256 x 256 pixels

Maps

Page 41: Bu

Zoom level 0:1 tile for the world

Maps

Page 42: Bu

Zoom level 1:4 tiles for the world

Maps

Page 43: Bu

Zoom level 2:16 tiles for the world

Maps

Page 44: Bu

# of tiles = 2z x 2z

Maps

Page 45: Bu
Page 46: Bu

http://tile.openstreetmap.org/8/58/105.pnghttp://tile.openstreetmap.org/14/3743/6745.png

Page 47: Bu

http://tile.openstreetmap.org/8/58/105.pnghttp://tile.openstreetmap.org/14/3743/6745.png

Page 48: Bu

http://tile.openstreetmap.org/8/58/105.pnghttp://tile.openstreetmap.org/14/3743/6745.png

Page 49: Bu

http://tile.openstreetmap.org/8/58/105.pnghttp://tile.openstreetmap.org/14/3743/6745.png

Page 50: Bu

http://tile.openstreetmap.org/8/58/105.pnghttp://tile.openstreetmap.org/14/3743/6745.png

Page 51: Bu

Layers & Overlay

Maps

Page 53: Bu

Maps

Style

Page 54: Bu
Page 55: Bu

Why open source maps?

⇢ Cost

⇢ Customization

⇢ Privacy & security

Maps

Page 56: Bu

osmdroid

#openmaps

Page 57: Bu

osmdroid

⇢ Android only

⇢ Raster tiles

⇢ Started in 2008

⇢ Based on Google Maps API v1

⇢ Online and offline tile sources

⇢ Icons, tracking, and shapes

Maps

Page 58: Bu
Page 59: Bu

Mapbox

#openmaps

Page 60: Bu

Mapbox

⇢ iOS & Android SDKs

⇢ Raster & vector tiles

⇢ Simple integration with Mapbox tile server

⇢ Alternate tile servers also supported

Maps

Page 61: Bu
Page 62: Bu

OpenScienceMap

#openmaps

Page 63: Bu

OpenScienceMap

⇢ Universität Bremen

⇢ Pure vector maps

⇢ Native rendering engine

⇢ Java wrapper

⇢ Objective-C translation

Maps

Page 64: Bu
Page 65: Bu

Tangram ES

#openmaps

Page 66: Bu

Tangram ES

⇢ Embedded systems version of Tangram for web

⇢ Native C++ rendering library

⇢ iOS, Android, and Raspberry Pi

⇢ EARLY work in progress!

Maps

Page 67: Bu
Page 68: Bu

#openmaps

Demo:Maps

Page 69: Bu

#openmaps

Part 3:Geolocation, Search & Routing

Page 70: Bu

Geolocation

#openmaps

Page 71: Bu

Location Services

Geolocation, Search & Routing

Page 72: Bu
Page 73: Bu

Location Providers

⇢ GPS

⇢ Wi-Fi

⇢ Cell network

⇢ Passive

⇢ Sensors

⇢ BLE

Geolocation, Search & Routing

Page 75: Bu

Location Providers

⇢ GPS

⇢ Wi-Fi

⇢ Cell network

⇢ Passive

⇢ Sensors

Geolocation, Search & RoutingFused Location Provider (Android) &

CoreLocation (iOS)

One interface to rule them all.X

Page 76: Bu
Page 77: Bu
Page 78: Bu

#openmaps

LOSTLocation Open Source TrackerLocation Open Source Tracker

Page 79: Bu

Not all those who wander are lost.― J.R.R. Tolkien, The Fellowship of the Ring

Page 80: Bu

LOST talks directly to the LocationManager

LOST

Page 81: Bu

Optimizations

⇢ Frequency

⇢ Accuracy

⇢ Battery Life

LOST

Page 82: Bu

Search

#openmaps

Page 83: Bu

Geocoding:Real world address -> Lat/Lng

Geolocation, Search & Routing

Page 84: Bu
Page 85: Bu

Reverse Geocoding:Lat/Lng -> Real world address

Geolocation, Search & Routing

Page 86: Bu
Page 87: Bu

Geographic Search Engine

Pelias

Page 88: Bu

Pelias

#openmaps

Page 89: Bu

Pelias is a modular open-source geocoder built on top of ElasticSearch for fast geocoding.

Pelias

Page 90: Bu

/suggest

The suggest endpoint provides a super-fast autocomplete. This API can be used to quickly find location names which BEGIN with the input text.

http://pelias.mapzen.com/suggest?input=big%20ben&lat=51.5&lon=-0.06

Pelias

Page 91: Bu
Page 92: Bu

/search

The search endpoint provides a full-text search. It will try to account for spelling mistakes and will search for your input at any position in the location name.

http://pelias.mapzen.com/search?input=shoreditch&lat=51.5&lon=-0.06

Pelias

Page 93: Bu
Page 94: Bu

/reverse

The reverse endpoint returns the nearest locations to your input lat/lon.

http://pelias.mapzen.com/reverse?lat=51.5&lon=-0.06

Pelias

Page 95: Bu
Page 96: Bu

Routing

#openmaps

Page 97: Bu

Turn-By-Turn Navigation

Geolocation, Search & Routing

Page 98: Bu

Public Transit

Geolocation, Search & Routing

Page 99: Bu

Open Source Routing Machine (OSRM)

#openmaps

Page 100: Bu

OSRM

Page 101: Bu

#openmaps

Demo:Geolocation, Search & Routing

Page 102: Bu

#openmaps

Part 4:Beacons & BLE

Page 103: Bu

Beacons are awesome!

⇢ How they work

⇢ Cool stuff you can do

⇢ Products and frameworks

⇢ Examples

Beacons & BLE

Page 104: Bu

A (quick) Guide to BT4

⇢ Basically three protocols in one

⇢ Bluetooth Low Energy

⇢ Operates in Two modes - Advertise and Connect

⇢ Only advertise is required - connect support is

optional

Page 105: Bu

Beacons

⇢ Beacons implement advertise only

⇢ Transmit at regular intervals

⇢ Simplification of the BLE implementation

⇢ Replaces MAC address with UUID

⇢ Major number is for grouping

⇢ Minor number is for individualization

Page 106: Bu

Indoor Location

⇢ Several different ways to accomplish

⇢ Wifi Triangulation

⇢ Ultrasonic Location

⇢ BLE Triangulation

⇢ Wifi is lackluster for triangulation

⇢ Ultrasonic need custom hardware

⇢ BLE range is poor compared to wifi or ultrasound

Page 107: Bu

Open Source Indoor Location

⇢ Currently in very early discussions in OSM

⇢ A few frameworks / attempts are being made:

⬝ Redpin

⬝ Cricket from MIT

⬝ iLocate

⬝ indoor.io

⇢ Needs more time to bake

⇢ In the mean time...

Page 108: Bu

#openmaps

Demo:Beacons & BLE

Page 109: Bu

Thanks!

#openmaps

Matthew Smollinger@mattsmollinger

Chuck Greb@ecgreb

http://sxsw.feedogo.com/fdbk.do?sid=IAP31861