SlideShare a Scribd company logo
Building Location-Aware Apps 
with Open Source & Open Data 
Chuck Greb | 11·18·2014 | AnDevCon
Mapzen is an open source mapping lab 
building and supporting open data and 
software to promote a healthy mapping 
ecosystem.
start where you are
Agenda 
Hour 1: Overview 
⇢ Location-aware apps 
⇢ Open source 
⇢ Open data 
Hour 2: Rendering 
⇢ Raster tiles 
⇢ Vector tiles 
Hour 3: Search & Navigation 
⇢ Location services 
⇢ Geocoding 
⇢ Routing
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
start where you are
Building Location-Aware Apps 
with Open Source & Open Data
Location-Aware Apps 
3 kinds of location-aware apps 
⇢ Mapping applications 
⇢ Location-based apps 
⇢ Apps with location-aware features
Mapping applications
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Location-based apps
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Apps with location-aware features
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Location-Aware Apps 
Common features 
⇢ Maps 
⇢ Geolocation 
⇢ Geocoding 
⇢ Reverse geocoding 
⇢ Search 
⇢ Navigation
Building Location-Aware Apps 
with Open Source & Open Data
Philosophy 
Open Source
Code 
Open Source
License 
Open Source
Community 
Open Source
Open Source 
Advantages 
⇢ Transparency 
⇢ Flexibility 
⇢ Compatibility 
⇢ Free!
Open Source 
Open source is not free like beer
Open Source 
Open source is free like a puppy
Building Location-Aware Apps 
with Open Source & Open Data
Availability & Access 
Open Data
Reuse & Redistribution 
Open Data
Universal participation 
Open Data
Open Knowledge Foundation 
https://okfn.org/ 
Open Data
Building Location-Aware Apps 
with Open Source & Open Data
Open Location Applications 
Components
Open Location Applications 
Datasource
Open Location Applications 
Vector Tiles
Open Location Applications 
Renderer
Open Location Applications 
Location Services 
GPS, WiFi, Network, Sensors, BLE
Open Location Applications 
Geocoder
Open Location Applications 
Search Engine
Open Location Applications 
Route Engine
OpenStreetMap (OSM)
OpenStreetMap (OSM) 
⇢ Crowdsourced Data 
⬝ Local knowledge 
⬝ Community driven 
⇢ Public Data 
⬝ 2007 TIGER import 
⬝ Manual import process 
⇢ Open Data Commons Open Database License (ODbL) 
⬝ Attribution 
⬝ Share-Alike 
⬝ Keep Open
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
osmdroid
2008 
osmdroid
osmdroid 
Based on Google Maps API v1
osmdroid 
Support for online and offline tile source
osmdroid 
Icons, tracking, and shapes
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Mapbox
Fork of osmdroid 
Mapbox
Mapbox 
Easy integration with Mapbox tile server
Mapbox 
<com.mapbox.mapboxsdk.views.MapView 
android:id="@+id/mapview" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
mapbox:mapid="Your Mapbox mapid" />
Mapbox 
MapView mapView = new MapView(this, "Your Mapbox mapid"); 
this.setContentView(mapView);
(Alternate tile servers also supported) 
Mapbox
Mapbox 
Custom styles & satellite imagery
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
OpenScienceMap
OpenScienceMap 
Universität Bremen
OpenScienceMap 
“OpenScienceMap provides free and open maps for Android 
with the fastest and 100% pure vector maps around.”
OpenScienceMap 
<org.oscim.android.MapView 
android:id="@+id/map" 
android:layout_width="match_parent" 
android:layout_height="match_parent" />
OpenScienceMap 
public class MyActivity extends MapActivity { 
... 
public Map getMap() { 
return super.map(); 
} 
}
OpenScienceMap 
@Override public void onCreate(Bundle icicle) { 
super.onCreate(icicle); 
UrlTileSource tileSource = new OSciMap4TileSource("http://vector.example.com/all"); 
VectorTileLayer baseLayer = getMap().setBaseMap(tileSource); 
getMap().layers().add(new BuildingLayer(getMap(), baseLayer)); 
getMap().layers().add(new PoiLayer(getMap(), baseLayer)); 
getMap().layers().add(new LabelLayer(getMap(), baseLayer)); 
baseLayer.setRenderTheme(ThemeLoader.load( 
AssetAdapter.g.openFileAsStream("styles/map.xml)"))); 
}
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Pelias
modular open-source geocoder 
Pelias
ElasticSearch 
Pelias
OSM 
Geoanmes 
Quattroshapes 
Pelias
Pelias Android SDK 
Pelias
Pelias 
Pelias.getPelias().suggest("Empire State Build", Callback<Result>); 
Pelias.getPelias().search("Empire State Building", "x1,y1,x2,y2", Callback<Result>);
Pelias 
{ "type": "FeatureCollection", 
"features": [{ 
"type": "Feature", 
"geometry": { 
"type": "Point", 
"coordinates": [ -73.98597, 40.74871 ]}, 
"properties": { 
"text": "Empire State Building, New York County, New York", 
"score": 1, 
"type": "geoname", 
"id": "5116597" 
} 
}, ... 
}
On the Road
On the Road 
Routing and Navigation
OSRM 
On the Road
On the Road 
Router.getRouter().setEndpoint("http://osrm.example.com") 
.setDriving() 
.setLocation(new double[]{lat, lng}) 
.setLocation(new double[]{lat, lng}) 
.setCallback(new Callback() { 
@Override 
public void success(Route route) { 
// do stuff 
} 
@Override 
public void failure(int statusCode) { 
// do stuff 
} 
}).fetch();
On the Road 
Features 
⇢ Navigation 
⇢ Snap to location 
⇢ Calculate distances 
⇢ Reroute
Location Open Source Tracker 
(LOST)
Drop-in replacement for 
FusedLocationProvider 
LOST
talks directly to LocationManager 
LOST
GPS 
Wi-Fi 
Cell Network 
LOST
Frequency 
Accuracy 
Battery Life 
LOST
Replay GPX trace file 
LOST
LOST 
LocationClient locationClient = new LocationClient(context, 
new LocationClient.ConnectionCallbacks() { 
@Override public void onConnected(Bundle bundle) { 
onLocationClientConnected(); 
} 
@Override public void onDisconnected() { 
onLocationClientDisconnected(); 
} 
});
LOST 
private void onLocationClientConnected() { 
Location lastLocation = locationClient.getLastLocation(); 
if (lastLocation != null) { 
// do stuff 
} 
LocationRequest locationRequest = LocationRequest.create(); 
locationRequest.setInterval(5000); 
locationClient.requestLocationUpdates(locationRequest, 
new LocationListener() { 
@Override public void onLocationChanged(Location location) { 
// do more stuff 
} 
}); 
}
Speakerbox
Speakerbox 
Features 
⇢ Text-to-Speech 
⇢ Initialization/Shutdown 
⇢ Mute/Unmute 
⇢ Remix!
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Open by Mapzen 
OpenScienceMap Pelias 
VTM Android SDK On the Road LOST 
Speakerbox 
Location TTS 
Pelias OSRM Manager 
Mapzen 
Vector Tile 
Service 
OpenGL ES
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
start where you are
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Break.
osmdroid 
Exercise #1
OpenScienceMap 
Exercise #2
Break.
OpenScienceMap + LOST 
Exercise #3
OpenScienceMap + LOST + Pelias 
Exercise #4
OpenScienceMap + LOST + Pelias + On the Road 
Exercise #5
thanks 
Chuck Greb | @ecgreb 
github.com/mapzen

More Related Content

PDF
OpenLayers Feature Frenzy
PDF
OL3-Cesium: 3D for OpenLayers maps
PDF
Where in the world is Franz Kafka? | Will LaForest, Confluent
PDF
Lost In The Clouds
PPT
Fosdem 2010 GT.M and OpenStreetMap
ODP
Lost In The Clouds
PPTX
Евгений Хыст: "Server-Side Geo-Clustering Based on Geohash"
PDF
3D mapping of a quarry
OpenLayers Feature Frenzy
OL3-Cesium: 3D for OpenLayers maps
Where in the world is Franz Kafka? | Will LaForest, Confluent
Lost In The Clouds
Fosdem 2010 GT.M and OpenStreetMap
Lost In The Clouds
Евгений Хыст: "Server-Side Geo-Clustering Based on Geohash"
3D mapping of a quarry

Viewers also liked (7)

PDF
Building Location-Aware Apps with Open Source & Open Data
PDF
PDF
Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
PDF
What's the deal with Android maps?
PDF
Google Charts for native Android apps
PDF
Data to Go: Mobile API Design (SXSW)
PDF
Testable Android Architecture
Building Location-Aware Apps with Open Source & Open Data
Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
What's the deal with Android maps?
Google Charts for native Android apps
Data to Go: Mobile API Design (SXSW)
Testable Android Architecture
Ad

Similar to Building Location-Aware Apps using Open Source (AnDevCon SF 2014) (20)

PDF
Android Geo Apps in Soviet Russia: Latitude and longitude find you
PDF
зиновьев алексей Droid con(16_9) android geo apps_ in soviet russia latitude ...
PDF
Build with live location data
PDF
What I’ve learned from building an app with OSM technologies
ODP
GeOng presentation about OpenStreetMap
PPT
OpenStreetMap Brighton 0.9999
PDF
Volunteered Geographic Information and OpenStreetMap
ODP
OSM vs Commercial providers
ODP
OpenStreetMap, an introduction
ODP
2018 11-10 From Printed Map to Live Navigation
PDF
PPT
From OpenStreetMap to PhillyTreeMap - Esri Dev Summit
PDF
Александр Золотарёв
PDF
20160306 公舘社區開放街圖研習
PDF
Osm application
PDF
OpenStreetMap at Camp Roberts
PDF
FreeMap Palestine November 2008
PDF
Maps API on_mobile_dev_festbangkok
ODP
Tokyo April 2008 Openstreetmap
PPTX
OpenStreetMap-Introduction
Android Geo Apps in Soviet Russia: Latitude and longitude find you
зиновьев алексей Droid con(16_9) android geo apps_ in soviet russia latitude ...
Build with live location data
What I’ve learned from building an app with OSM technologies
GeOng presentation about OpenStreetMap
OpenStreetMap Brighton 0.9999
Volunteered Geographic Information and OpenStreetMap
OSM vs Commercial providers
OpenStreetMap, an introduction
2018 11-10 From Printed Map to Live Navigation
From OpenStreetMap to PhillyTreeMap - Esri Dev Summit
Александр Золотарёв
20160306 公舘社區開放街圖研習
Osm application
OpenStreetMap at Camp Roberts
FreeMap Palestine November 2008
Maps API on_mobile_dev_festbangkok
Tokyo April 2008 Openstreetmap
OpenStreetMap-Introduction
Ad

More from Chuck Greb (6)

PDF
Notifunk
PDF
AnDevCon 2013 Roundup
PDF
Data to Go: Mobile API Design
PDF
Android TDD
PDF
Data To Go: Mobile API Design (Lightning Talk)
PDF
HowAboutWe... Build an Android App
Notifunk
AnDevCon 2013 Roundup
Data to Go: Mobile API Design
Android TDD
Data To Go: Mobile API Design (Lightning Talk)
HowAboutWe... Build an Android App

Recently uploaded (20)

PPTX
Big Data Technologies - Introduction.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Cloud computing and distributed systems.
PDF
KodekX | Application Modernization Development
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Machine learning based COVID-19 study performance prediction
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Encapsulation theory and applications.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Big Data Technologies - Introduction.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Review of recent advances in non-invasive hemoglobin estimation
Cloud computing and distributed systems.
KodekX | Application Modernization Development
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
The AUB Centre for AI in Media Proposal.docx
20250228 LYD VKU AI Blended-Learning.pptx
Spectral efficient network and resource selection model in 5G networks
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Advanced methodologies resolving dimensionality complications for autism neur...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Machine learning based COVID-19 study performance prediction
Chapter 3 Spatial Domain Image Processing.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Empathic Computing: Creating Shared Understanding
Encapsulation theory and applications.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...

Building Location-Aware Apps using Open Source (AnDevCon SF 2014)