+ All Categories
Home > Internet > Making the entire world accessible via a single API - the OpenCage Geocoder

Making the entire world accessible via a single API - the OpenCage Geocoder

Date post: 21-Jan-2018
Category:
Upload: ed-freyfogle
View: 39 times
Download: 1 times
Share this document with a friend
69
Making the entire world accessible via a single API Ed Freyfogle Barcelona Data Engineering - 30 Nov. 2017 http://opencagedata.com @opencagedata
Transcript
Page 1: Making the entire world accessible via a single API - the OpenCage Geocoder

Making the entire world accessible via a single API

Ed FreyfogleBarcelona Data Engineering - 30 Nov. 2017

http://opencagedata.com@opencagedata

Page 2: Making the entire world accessible via a single API - the OpenCage Geocoder

- Some background

- Technical overview

- Build versus Buy?

- Questions

Overview

Page 3: Making the entire world accessible via a single API - the OpenCage Geocoder

$whoami

Page 4: Making the entire world accessible via a single API - the OpenCage Geocoder

$whoami- Co-founder of OpenCage

- Before that, co-founded a real estate metasearch engine called Nestoria. 10 years, 20 employees, €4.5M in revenue

- Way, way before that, first developer at yahoo.de

- Moved to BCN to live the good life

Page 5: Making the entire world accessible via a single API - the OpenCage Geocoder

opencagedata.com

Page 6: Making the entire world accessible via a single API - the OpenCage Geocoder

WTF is geocoding?

Page 7: Making the entire world accessible via a single API - the OpenCage Geocoder

Where are we?

Page 8: Making the entire world accessible via a single API - the OpenCage Geocoder
Page 9: Making the entire world accessible via a single API - the OpenCage Geocoder

Barcelona

Page 10: Making the entire world accessible via a single API - the OpenCage Geocoder

BarcelonaIronhack BCN

Page 11: Making the entire world accessible via a single API - the OpenCage Geocoder

BarcelonaIronHack BCN

08018

Page 12: Making the entire world accessible via a single API - the OpenCage Geocoder

BarcelonaIronHack BCN

08002Carrer de Pamplona

Poblenou

Page 13: Making the entire world accessible via a single API - the OpenCage Geocoder

BarcelonaIronHack BCN

08002Carrer de Pamplona

Poblenou

Europe

Page 14: Making the entire world accessible via a single API - the OpenCage Geocoder

BarcelonaIronHack BCN

08002Carrer de Pamplona

Poblenou

Europe

Spain / Rep. of CataloniaNEW!

Page 15: Making the entire world accessible via a single API - the OpenCage Geocoder
Page 16: Making the entire world accessible via a single API - the OpenCage Geocoder

41.39778,2.19011

Page 17: Making the entire world accessible via a single API - the OpenCage Geocoder
Page 18: Making the entire world accessible via a single API - the OpenCage Geocoder

placename lat/long

Page 19: Making the entire world accessible via a single API - the OpenCage Geocoder

placename long/lat

forward

Page 20: Making the entire world accessible via a single API - the OpenCage Geocoder

placename long/lat

forward

reverse

Page 21: Making the entire world accessible via a single API - the OpenCage Geocoder

Why Geocode?- Vehicle tracking

- Routing

- Data enrichment

- Put points on a map

- Image processing

Page 22: Making the entire world accessible via a single API - the OpenCage Geocoder
Page 23: Making the entire world accessible via a single API - the OpenCage Geocoder

Yes!

Page 24: Making the entire world accessible via a single API - the OpenCage Geocoder

Yes! but …T&Csexpensive at volume

Page 25: Making the entire world accessible via a single API - the OpenCage Geocoder

OpenStreetMap

Page 26: Making the entire world accessible via a single API - the OpenCage Geocoder

Yes!

Page 27: Making the entire world accessible via a single API - the OpenCage Geocoder

Yes! but …not for high volume usevariable coverage

Page 28: Making the entire world accessible via a single API - the OpenCage Geocoder
Page 29: Making the entire world accessible via a single API - the OpenCage Geocoder

Yes!

Page 30: Making the entire world accessible via a single API - the OpenCage Geocoder

Yes! and …one API, many geocodersfree as in freedomenterprise level reliability

Page 31: Making the entire world accessible via a single API - the OpenCage Geocoder

- Some background

- Technical overview

- Build versus Buy?

- Questions

Overview

Page 32: Making the entire world accessible via a single API - the OpenCage Geocoder
Page 33: Making the entire world accessible via a single API - the OpenCage Geocoder

OpenStreetMapwww.openstreetmap.org

Page 34: Making the entire world accessible via a single API - the OpenCage Geocoder

OpenStreetMap- Crowdsourced geodata. Anyone can edit. 4 million reg. users

- Bad name. Is a database, not a map.

- 3 million edits per day. And growing.

- Operations run by volunteers.

- Master DB is hosted at a university in London

- Data is under ODbL License

- Many, many different tools for editing, querying, visualizing the data

Page 35: Making the entire world accessible via a single API - the OpenCage Geocoder

Example

$ curl ‘https://api.opencagedata.com/geocode/v1/json?q=41.39778,2.19011&key=...&pretty=1’

Page 36: Making the entire world accessible via a single API - the OpenCage Geocoder

Example

$ curl ‘https://api.opencagedata.com/geocode/v1/json?q=41.39778,2.19011&key=...&pretty=1’

"components": { "ISO_3166-1_alpha-2": "ES", "_type": "pub", "city": "Barcelona", "city_district": "Sant Martí", "country": "Spain", "country_code": "es", "county": "BCN", "house_number": "96", "postcode": "08018", "pub": "Sonora Sport Tavern", "road": "Carrer de Pamplona", "state": "Catalonia", "suburb": "el Parc i la Llacuna del Poblenou" }, "formatted": "Sonora Sport Tavern, Carrer de Pamplona, 96, 08018 Barcelona, Spain",

Page 37: Making the entire world accessible via a single API - the OpenCage Geocoder

https://geocoder.opencagedata.com/code

Libraries for - Perl, PHP, Python, Ruby, R, Java, .NET, elixir,

Haskell, Go, Erlang, nodejs, Stata, perl6, iOS

- Leaflet, OpenLayers

TMTOWTDI

Page 38: Making the entire world accessible via a single API - the OpenCage Geocoder

ArchitectureHTTP request

Page 39: Making the entire world accessible via a single API - the OpenCage Geocoder

ArchitectureHTTP request LB

LB

- HAProxy- Two different physical locations

Page 40: Making the entire world accessible via a single API - the OpenCage Geocoder

ArchitectureHTTP request LB

LBHTTP request LB

meta

- ubuntu- apache- mod_perl

Page 41: Making the entire world accessible via a single API - the OpenCage Geocoder

ArchitectureHTTP request LB

LBHTTP request LB

meta

Kong

HTTP request

- authentication- validity checking- routing

Page 42: Making the entire world accessible via a single API - the OpenCage Geocoder

ArchitectureHTTP request LB

LBHTTP request LB

meta

Kong

HTTP request

geocoder geocoder geocoder

Page 43: Making the entire world accessible via a single API - the OpenCage Geocoder

ArchitectureHTTP request LB

LBHTTP request LB

meta

Kong

HTTP request

geocoder geocoder geocoder

OSMContinually updating

HTTP request

Page 44: Making the entire world accessible via a single API - the OpenCage Geocoder

ArchitectureHTTP request LB

LBHTTP request LB

meta

Kong

HTTP request

geocoder geocoder geocoder

OSMContinually updating

- accept response, error check- standardize format- rank- add annotations- send to client in XML, JSON, etc

Page 45: Making the entire world accessible via a single API - the OpenCage Geocoder

- timezones - geohash, MGRS, Maidenhead, DMS- what3words- calling codes, currency- and more ...

Annotations

Page 46: Making the entire world accessible via a single API - the OpenCage Geocoder

Formatting

$ curl ‘https://api.opencagedata.com/geocode/v1/json?q=41.39778,2.19011&key=...&pretty=1’

"components": { "ISO_3166-1_alpha-2": "ES", "_type": "pub", "city": "Barcelona", "city_district": "Sant Martí", "country": "Spain", "country_code": "es", "county": "BCN", "house_number": "96", "postcode": "08018", "pub": "Sonora Sport Tavern", "road": "Carrer de Pamplona", "state": "Catalonia", "suburb": "el Parc i la Llacuna del Poblenou" }, "formatted": "Sonora Sport Tavern, Carrer de Pamplona, 96, 08018 Barcelona, Spain",

Page 47: Making the entire world accessible via a single API - the OpenCage Geocoder

115 New Cavendish Street, London W1T 5DU, United Kingdom

223 William Street, Melbourne VIC 3000, Australia

Rosenthaler Straße 1, 10119 Berlin, Germany

Via Pisacane, 13, 76121 Barletta BT, Italy

3 Upper Alma Road, Rosebank, Cape Town, 7700, South Africa

Formatting

Page 48: Making the entire world accessible via a single API - the OpenCage Geocoder

ArchitectureHTTP request LB

LBHTTP request LB

meta

Kong

HTTP request

geocoder geocoder geocoder

OSMContinually updating

- logging- monitoring- emails

metrics

scp

Page 49: Making the entire world accessible via a single API - the OpenCage Geocoder

Monitoring

We use StatusCake

Page 50: Making the entire world accessible via a single API - the OpenCage Geocoder

- Dev/testing process

- Deployment

- User registration / onboarding

- Billing

Not covered

Page 51: Making the entire world accessible via a single API - the OpenCage Geocoder

- Some background

- Technical overview

- Build versus Buy?

- Questions

Overview

Page 52: Making the entire world accessible via a single API - the OpenCage Geocoder

- Unable to buy- Lack of finance- Lack of affordable, reliable vendor

When to build

Page 53: Making the entire world accessible via a single API - the OpenCage Geocoder

- Unable to buy

- Core to your service

When to build

Page 54: Making the entire world accessible via a single API - the OpenCage Geocoder

- Unable to buy

- Core to your service- Critical differentiator- Privacy / data protection issues- Legal requirement

When to build

Page 55: Making the entire world accessible via a single API - the OpenCage Geocoder

- Unable to build

When to buy

Page 56: Making the entire world accessible via a single API - the OpenCage Geocoder

- Unable to build

- Need to move fast

When to buy

Page 57: Making the entire world accessible via a single API - the OpenCage Geocoder

- Unable to build

- Need to move fast

- Is non-core

When to buy

Page 58: Making the entire world accessible via a single API - the OpenCage Geocoder

- Unable to build

- Need to move fast

- Is non-core

- Unable to maintain

When to buy

Page 59: Making the entire world accessible via a single API - the OpenCage Geocoder

- Financial cost

- Opportunity costs

- Staffing costs

Cost analysis

Page 60: Making the entire world accessible via a single API - the OpenCage Geocoder

- Industry trend has been towards buying- Servers (AWS, Dropbox, etc)- Login / Identity (FB, google, etc)- Billing (Stripe)- 1000s of SaaS businesses

The trend

Page 61: Making the entire world accessible via a single API - the OpenCage Geocoder

- Engineers love to build

MAIN POINT

Page 62: Making the entire world accessible via a single API - the OpenCage Geocoder

- Engineers love to build

- Building is (comparatively) easy

MAIN POINT

Page 63: Making the entire world accessible via a single API - the OpenCage Geocoder

- Engineers love to build

- Building is (comparatively) easy

- MAINTENANCE IS REALLY HARD!!!!

MAIN POINT

Page 64: Making the entire world accessible via a single API - the OpenCage Geocoder

- Some background

- Technical overview

- Build versus Buy?

- Questions

Overview

Page 65: Making the entire world accessible via a single API - the OpenCage Geocoder

Three more things

Page 66: Making the entire world accessible via a single API - the OpenCage Geocoder

Three more things1. Lifetime 10% discount

use code: XXXXXX

Page 67: Making the entire world accessible via a single API - the OpenCage Geocoder

Three more things1. Lifetime 10% discount

use code: XXXXXX

2. Happy to pay anyone who wants to writea wrapper library: F#, Scala, Lua, etc

Page 68: Making the entire world accessible via a single API - the OpenCage Geocoder

Three more things My friends at AVUXI are hiring http://www.avuxi.com

Page 69: Making the entire world accessible via a single API - the OpenCage Geocoder

Ed FreyfogleBarcelona Data Engineering - 30 Nov. 2017

https://opencagedata.com@opencagedata

Thanks! Questions?


Recommended