building location-aware apps with open source & open data (sxsw 2015)

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

Upload: chuck-greb

Post on 16-Jul-2015

307 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Building Location-Aware Appswith Open Source & Open Data

#openmaps

Matthew Smollinger@mattsmollinger

Chuck Greb@ecgreb

SXSW Interactive | 14 March 2015

Page 2: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

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

ecosystem.

Page 3: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

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

market.

Page 4: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

start where you are

Page 5: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

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: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

#openmaps

Part 1:Overview

Page 7: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Building Location-Aware Appswith Open Source & Open Data

#openmaps

Page 8: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

3 kinds of location-aware apps

⇢ Mapping applications

⇢ Location-based apps

⇢ Apps with location-aware features

Location-Aware Apps

Page 9: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Mapping applications

Page 10: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
Page 11: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
Page 12: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
Page 13: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Location-based apps

Page 14: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
Page 15: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
Page 16: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
Page 17: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Wearable integration

Page 18: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Apps with location-aware features

Page 19: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
Page 20: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
Page 21: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Common features

⇢ Maps

⇢ Geolocation

⇢ Search

⇢ Navigation

Location-Aware Apps

Page 22: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Building Location-Aware Appswith Open Source & Open Data

Page 23: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Code

Open Source

Page 24: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Philosophy

Open Source

Page 25: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

License

Open Source

Page 26: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Community

Open Source

Page 27: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Advantages

⇢ Transparency

⇢ Flexibility

⇢ Compatibility

⇢ Free!

Location-Aware Apps

Page 28: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Open source is not free like beer

Open Source

Page 29: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Open source is free like a puppy

Open Source

Page 30: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Building Location-Aware Appswith Open Source & Open Data

Page 31: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Availability & Access

Open Data

Page 32: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Reuse & Redistribution

Open Data

Page 33: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Universal Participation

Open Data

Page 34: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Open Knowledge Foundationhttps://okfn.org/

Open Data

Page 35: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

OpenStreetMap (OSM)

⇢ Crowdsourced & public data

⇢ Local knowledge

⇢ Attribution

⇢ Share-alike

Open Data

Page 36: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
Page 37: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

#openmaps

Part 2:Maps

Page 38: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Datasource

Maps

Page 39: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Tiles

Maps

Raster Vector

Page 40: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

256 x 256 pixels

Maps

Page 41: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Zoom level 0:1 tile for the world

Maps

Page 42: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Zoom level 1:4 tiles for the world

Maps

Page 43: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Zoom level 2:16 tiles for the world

Maps

Page 44: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

# of tiles = 2z x 2z

Maps

Page 45: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
Page 46: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

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

Page 47: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

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

Page 48: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

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

Page 49: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

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

Page 50: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

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

Page 51: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Layers & Overlay

Maps

Page 53: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Maps

Style

Page 54: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
Page 55: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Why open source maps?

⇢ Cost

⇢ Customization

⇢ Privacy & security

Maps

Page 56: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

osmdroid

#openmaps

Page 57: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

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: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
Page 59: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Mapbox

#openmaps

Page 60: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Mapbox

⇢ iOS & Android SDKs

⇢ Raster & vector tiles

⇢ Simple integration with Mapbox tile server

⇢ Alternate tile servers also supported

Maps

Page 61: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
Page 62: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

OpenScienceMap

#openmaps

Page 63: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

OpenScienceMap

⇢ Universität Bremen

⇢ Pure vector maps

⇢ Native rendering engine

⇢ Java wrapper

⇢ Objective-C translation

Maps

Page 64: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
Page 65: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Tangram ES

#openmaps

Page 66: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

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: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
Page 68: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

#openmaps

Demo:Maps

Page 69: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

#openmaps

Part 3:Geolocation, Search & Routing

Page 70: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Geolocation

#openmaps

Page 71: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Location Services

Geolocation, Search & Routing

Page 72: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
Page 73: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Location Providers

⇢ GPS

⇢ Wi-Fi

⇢ Cell network

⇢ Passive

⇢ Sensors

⇢ BLE

Geolocation, Search & Routing

Page 75: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

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: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
Page 77: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
Page 78: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

#openmaps

LOSTLocation Open Source TrackerLocation Open Source Tracker

Page 79: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

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

Page 80: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

LOST talks directly to the LocationManager

LOST

Page 81: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Optimizations

⇢ Frequency

⇢ Accuracy

⇢ Battery Life

LOST

Page 82: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Search

#openmaps

Page 83: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Geocoding:Real world address -> Lat/Lng

Geolocation, Search & Routing

Page 84: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
Page 85: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Reverse Geocoding:Lat/Lng -> Real world address

Geolocation, Search & Routing

Page 86: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
Page 87: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Geographic Search Engine

Pelias

Page 88: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Pelias

#openmaps

Page 89: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

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

Pelias

Page 90: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

/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: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
Page 92: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

/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: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
Page 94: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

/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: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
Page 96: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Routing

#openmaps

Page 97: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Turn-By-Turn Navigation

Geolocation, Search & Routing

Page 98: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Public Transit

Geolocation, Search & Routing

Page 99: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Open Source Routing Machine (OSRM)

#openmaps

Page 100: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

OSRM

Page 101: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

#openmaps

Demo:Geolocation, Search & Routing

Page 102: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

#openmaps

Part 4:Beacons & BLE

Page 103: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Beacons are awesome!

⇢ How they work

⇢ Cool stuff you can do

⇢ Products and frameworks

⇢ Examples

Beacons & BLE

Page 104: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

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: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

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: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

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: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

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: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

#openmaps

Demo:Beacons & BLE

Page 109: Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)

Thanks!

#openmaps

Matthew Smollinger@mattsmollinger

Chuck Greb@ecgreb

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