+ All Categories
Home > Documents > Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office •...

Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office •...

Date post: 22-Sep-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
77
Resolving addresses to geocoordinates, using OpenStreetMap or ArcGIS Andreas ‚ads‘ Scherbaum
Transcript
Page 1: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Resolving addresses to geocoordinates, using

OpenStreetMap or ArcGIS

Andreas ‚ads‘ Scherbaum

Page 2: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Andreas Scherbaum • Works with databases since 1997, with

PostgreSQL since 1998

• Founding member of PGEU

• Board of Directors: PGEU

• PostgreSQL Regional Contact for Germany

• Ran my own company around PostgreSQL

for 7+ years

• Joined EMC in 2011, working on PostgreSQL

and Greenplum projects

Page 3: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

ToC

Page 4: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Table of Content • Why (resolve addresses)

• How (to)

• Measure (the results)

• What‘s next

Page 5: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Why (resolve addresses)

Page 6: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Address Format • If you are lucky:

Street HouseNr City ZIP Country

… … … … …

… … … … …

… … … … …

Page 7: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Address Format • But usually:

Address

1 Eagle Dr, Missouri, United States

1198 Toorak Rd, Camberwell VIC 3124, Australia

Widdersdorfer Straße 427, 50933 Köln

Kexueyuan South Road, Zhongguancun, Beijing 100190, China

北京市海淀区科学院南路2号融科资讯中心C座南楼5层

House number in front of street

Page 8: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Address Format • But usually:

Address

1 Eagle Dr, Missouri, United States

1198 Toorak Rd, Camberwell VIC 3124, Australia

Widdersdorfer Straße 427, 50933 Köln

Kexueyuan South Road, Zhongguancun, Beijing 100190, China

北京市海淀区科学院南路2号融科资讯中心C座南楼5层

ZIP code after city name

Page 9: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Address Format • But usually:

Address

1 Eagle Dr, Missouri, United States

1198 Toorak Rd, Camberwell VIC 3124, Australia

Widdersdorfer Straße 427, 50933 Köln

Kexueyuan South Road, Zhongguancun, Beijing 100190, China

北京市海淀区科学院南路2号融科资讯中心C座南楼5层

House number after street, ZIP code in front of city

Page 10: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Address Format • But usually:

Address

1 Eagle Dr, Missouri, United States

1198 Toorak Rd, Camberwell VIC 3124, Australia

Widdersdorfer Straße 427, 50933 Köln

Kexueyuan South Road, Zhongguancun, Beijing 100190, China

北京市海淀区科学院南路2号融科资讯中心C座南楼5层

ZIP code after city name

Page 11: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Address Format • But usually:

Address

1 Eagle Dr, Missouri, United States

1198 Toorak Rd, Camberwell VIC 3124, Australia

Widdersdorfer Straße 427, 50933 Köln

Kexueyuan South Road, Zhongguancun, Beijing 100190, China

北京市海淀区科学院南路2号融科资讯中心C座南楼5层

Need to parse and resolve that … But: you don‘t want to do this on your own!

What is that?

Page 12: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Geolocation Services • Verify and normalize addresses

o Whatever a customer entered, store the correct address

• Identify address or location o Country, Region, City, Street

Page 13: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Address Lookup • Where are these streets:

o Wilhelmstraße, 10117 Berlin

o Hans-von_Bülow-Straße, 10785 Berlin

o Scheidemannstraße, 10557 Berlin

o Lindenstraße, 10969 Berlin

Page 14: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Address Lookup

© Google Maps

Page 15: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Car Insurance Fraud • Insurance companies offer savings based on

information like state/parking/living address o Good to know how far away from the registered address (usual overnight

parking place) an accident happened, or a car was stolen

o Address manipulation is a serious issue and a growing area for insurance

companies: compare all known addresses for a customer

o Find „hot spots“

Page 16: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Insurance Fraud • „Hot Spots“

What happened here?

© Wikipedia

Page 17: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Health Care Fraud • Discover if policy holders claim money for other

people o Look at billing addresses, doctors and hospitals addresses ect.

Page 18: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Health Care Fraud • Germany has a good Health Care system

o Ever since 2006, Germany is rolling out a „health card“ (Euphemism)

o Everyone can visit a doctor if he possesses a health card

o A photographic image is required on the „health card“

• The photo cannot be verified

Page 19: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Nearest shop/office • Retailers, banks and many others can figure out the

closest shop or branch office for every customer o Send personalized (news)letters

o Include nearest address and distance (even time, with routing)

• Small shops can figure out if it‘s worth sending

advertisement to a customer

Page 20: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Sales Tax (VAT) • The European Union changed VAT (in 2007) that

from 2015 on VAT on services is charged in the

consumer country o Every service provider has to handle sales taxes from all other EU countries

o EU right now has 28 member countries

o Conclusion: know where your customer lives

„Customer Friendly“ …?

Page 21: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Verify addresses • Sometimes it‘s useful to just verify addresses

• Ever been in a shop where they ask for your zip

code? o „We want to improve our service“

o My usual answer: 78266

• Ever tried to match addresses? o „Müller Straße, 51149 Köln“

o „Mueller Straße, 51149 Koeln“

o „Müller Strasse, Köln, 51149“

o „Muller Str, Cologne, 51149“

Remember this one

Page 22: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

In my area of work … • I work for a Data Warehouse company …

o Many of our customers have millions of addresses in the EDW

o Guess how many are verified, or even updated …

Page 23: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Let‘s Talk Business • Let‘s imagine, you run a small business

• A pizza shop

• State-of-the-art website

• Online orders

Page 24: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Let‘s Talk Business • Let‘s imagine, you run a small business

• A chinese fast food delivery shop

• State-of-the-art website

• Online orders

• Your claim: • Always hot food, or money back

Page 25: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Berlin

© Wikipedia

Page 26: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Beijing

© OpenStreetMap

Page 27: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Germany!

© Wikipedia

Page 28: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Do you know your customers?

• Where is: • Uthlande Street 1, 25849 Pellworm, Germany

• (address of the local government)

Page 29: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Do you know your customers?

• Where is: • Uthlande Street 1, 25849 Pellworm, Germany

• (address of the local government)

• It‘s in the „Northern Friesland“ district

© Wikipedia

Page 30: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Do you know your customers?

• Where is: • Uthlande Street 1, 25849 Pellworm, Germany

• (address of the local government)

• Only reachable via ferry • Good luck with your hot pizza in the evening

© Wikipedia

Page 31: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Do you know your customers?

• Where is: • Junkerstraße 86, 78266 Büsingen am Hochrhein, Germany

• (address of the local government)

Page 32: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Do you know your customers?

• Where is: • Junkerstraße 86, 78266 Büsingen am Hochrhein, Germany

• (address of the local government)

• It‘s entirely surrounded by the Swiss canton of

Schaffhausen (enclave) • Food delivery from Germany to Switzerland has to pass customs

© Wikipedia

Remember this one?

Page 33: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Do you know your customers?

• Where is: • Ullasvej 23, 3700 Rønne, Denmark

• (address of the local government)

Page 34: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Do you know your customers?

• Where is: • Ullasvej 23, 3700 Rønne, Denmark

• (address of the local government)

• It‘s on Bornholm o Danish island in the Baltic Sea

o Google says: need a ferry

o and 4.5 hours

© Wikipedia

Page 35: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Who cares? • No one cares about corner cases, right?

• Let‘s deal with that later … • Yeah, always a good idea, especially in IT

Page 36: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Let‘s start easy • Zip codes, that works everywhere, every street has

one

• Germany uses 5 digits for zip codes • Other countries use 4, or 6, or characters

• But note: close number‘s don‘t imply close

distance

Page 37: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Geography of Germany • Wikipedia:

o northernmost point in mainland Germany: Aventoft, Schleswig-Holstein 54°54′N 8°49′E

o southernmost point: Haldenwanger Eck, Oberstdorf, Bavaria 47°16′12.39″N 10°10′41.95″E

𝑥

1 𝑧𝑖𝑝 𝑐𝑜𝑑𝑒=

850 𝑘𝑚

99999 𝑧𝑖𝑝 𝑐𝑜𝑑𝑒 𝑥 =

850 𝑘𝑚

99999 𝑧𝑖𝑝 𝑐𝑜𝑑𝑒= 0.0085 km

SELECT ST_Distance_Sphere( ST_GeomFromText( 'POINT(54.900176 8.816667)', 4326 ), ST_GeomFromText( 'POINT(47.270108 10.178319)', 4326 )) / 1000;

?column?

------------------

850.346457590326

(1 row)

Page 38: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Let‘s start easy • Question: what is the distance between:

• 08523 Plauen, Germany

• 95028 Hof (Saale), Germany

𝑥

86505 𝑧𝑖𝑝 𝑐𝑜𝑑𝑒=

850 𝑘𝑚

99999 𝑧𝑖𝑝 𝑐𝑜𝑑𝑒

𝑥 =850 𝑘𝑚 ∗ 86505 𝑧𝑖𝑝 𝑐𝑜𝑑𝑒

99999 𝑧𝑖𝑝 𝑐𝑜𝑑𝑒= 735.4 km

Page 39: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Let‘s start easy • Question: what is the distance between:

• 08523 Plauen, Germany

• 95028 Hof (Saale), Germany

• Merely 42 km

© Google Maps

Page 40: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Ok … • That escalated quickly …

• Zip codes aren‘t easy

• Ferry doesn‘t work, and neither does customs

$ psql psql (9.4.4) Type "help" for help.

Page 41: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Time … • to GeoCode addresses

Page 42: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Geocoding • Look up geocoordinates

o Longitude: X

o Latitude: Y

© Wikipedia

Page 43: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Reverse Geocoding • Look up near(est) address for geocoordinates

Page 44: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

How (to)

Page 45: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Data Sources • OpenStreetMap

• ArcGIS

• Google Maps

• Bing Maps

• …

• TIGER (USA)

• …

Page 46: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

OpenStreetMap • „OpenStreetMap is built by a community of

mappers that contribute and maintain data about

roads, trails, cafés, railway stations, and much more,

all over the world.” o Quote from http://www.openstreetmap.org/about

• Project „Nominatim“ provides a webservice for

Geocoding and Reverse Geocoding

• You can (and should) setup your own server

Page 47: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

ArcGIS • Commercial service, offering maps, web platform,

app framework, paid services and much more

• Also provides free Geocode and Reverse Geocode

in the web API

Page 48: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

PostgreSQL • Let‘s do this from with the database:

o pg_osm: https://github.com/andreasscherbaum/pg_osm

o pg_arcgis: https://github.com/andreasscherbaum/pg_arcgis

arcgis=# SELECT * from arcgis.find('3495 Deer Creek

Road Palo Alto, CA 94304');

NOTICE: resolving: 3495 Deer Creek Road Palo Alto, CA

94304

CONTEXT: PL/Python function "find"

x | y | wkid

----------------+---------------+------

-122.148659529 | 37.3939849106 | 4326

(1 row)

Page 49: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

PostgreSQL arcgis=# select arcgis.find_yx('3495 Deer

Creek Road Palo Alto, CA 94304');

find_yx

--------------------------------

{37.3939849106,-122.148659529}

(1 row)

Page 50: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

find_yx(lat, lon)

© Google Maps

Page 51: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Measure (the results)

Page 52: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

First demo set • This started as a project for Pivotal Greenplum

Database (a PostgreSQL fork) - performance

• Pivotal has 17 offices worldwide

• Scrape the addresses from the website and load

them into the database

Page 53: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

DEMO?

Page 54: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

DEMO! • Lookup addresses (live/cached)

o Single address (live)

o Pivotal offices (live)

Page 55: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Pivotal addresses • ArcGIS: worked out of the box (just removed „floor“,

„suite“ ect) for 15 out of 17 addresses o China and South Korea are listed for weak data

arcgis=# select address, location_tmp from test_arcgis.pivotal_addresses order by id;

address | location_tmp

--------------------------------------------------------------------------------------------+------------------------------

3495 Deer Creek Road Palo Alto, CA 94304 | -122.148659529 37.3939849106

38 Xiaoyun Road, Beijing, 100027 China |

City Gate, Mahon, Cork, Ireland | -8.405141449 51.8861076

Am Kronberger Hang 2A, Schwalbach Frankfurt 65824, Germany | 8.532926108 50.1649573

Bentima House, 168-172 Old Street, London EC1V 9BP, United Kingdom | -2.61271281 51.225472175

Ribera del Loira 8, Edificio Paris, Campo de las Naciones, Madrid 28042, Spain | -3.591640162 40.462199799

Via Spadolini, 5, Edificio A, Milano 20141, Italy | 9.190325913 45.443185172

2000 Bandra Kurla Complex, Bandra East, Mumbai, Maharashtra, 400051, IND | 72.859927111 19.062134031

625 Avenue of the Americas, New York, NY 10011-2020, United States | -73.9948157784 40.7401885687

80 Quai Voltaire, Bezons Cedex 95876, France | 2.2202362 48.92280968

875 Howard St, San Francisco, CA 94103, United States | -122.404315996 37.7819550187

152 Teheran-ro, Seoul, 135-984, Korea |

1 Changi Business Park Central 1, #08-101, Changi City, Singapore 486036 | 103.962589042 1.33351667

207 Pacific Highway, St Leonards, Sydney, NSW, 2065, Australia | 151.193129783 -33.823683444

2-1-1 Yoyogi Shibuya-ku, Tokyo 151-0053, Japan | 139.698956933 35.686568319

1 Toronto Street, Suite 1100, Toronto, Ontario, M5C 2V6, Canada | -79.376037693 43.649893575

Edisonbaan 14b, 3439 MN Nieuwegein, 3430 AB Nieuwegein, Netherlands PO Box 97, Netherlands | 5.098633003 52.033586606

(17 rows)

Page 56: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Pivotal addresses • OSM: out of the box, only 4 addresses resolved

arcgis=# select address,location_tmp from test_osm.pivotal_addresses order by id;

address | location_tmp

---------------------------------------------------------------------------------------------+----------------------------

3495 Deer Creek Road Palo Alto, CA 94304 | -122.14782867439 37.394282

38 Xiaoyun Road, Beijing, 100027 China | 116.4616591 39.9602201

City Gate, Mahon, Cork, Ireland |

Am Kronberger Hang 2A, Schwalbach Frankfurt 65824, Germany |

Bentima House, 168-172 Old Street, London EC1V 9BP, United Kingdom |

Ribera del Loira 8, Edifico Paris, Campo de las Naciones, Madrid 28042, Spain |

Via Spadolini, 5, Edificio A, Milano 20141, Italy |

2000 Bandra Kurla Complex, Bandra East, Mumbai, Maharashtra, 400051, IND |

625 Avenue of the Americas, New York, NY 10011-2020, United States |

80 Quai Voltaire, Bezons Cedex 95876, France |

875 Howard St, San Francisco, CA 94103, United States | -122.4137689 37.774516

152 Teheran-ro, Seoul, 135-984, Korea |

1 Changi Business Park Central 1, #08-101, Changi City, Singapore 486036 |

207 Pacific Highway, St Leonards, Sydney, NSW, 2065, Australia | 151.1883288 -33.8245562

2-1-1 Yoyogi Shibuya-ku, Tokyo 151-0053, Japan |

1 Toronto Street, Suite 1100, Toronto, Ontario, M5C 2V6, Canada |

Edisonbaan 14b , 3439 MN Nieuwegein, 3430 AB Nieuwegein, Netherlands PO Box 97, Netherlands |

(17 rows)

Page 57: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Pivotal addresses • OSM: with „address tuning“, max 10 addresses resolved

o But: China and South Korea resolved!

arcgis=# select address,location_tmp from test_osm.pivotal_addresses order by id;

address | location_tmp

--------------------------------------------------------------------------------+----------------------------

3495 Deer Creek Road Palo Alto, CA 94304 | -122.14782867439 37.394282

38 Xiaoyun Road, Beijing, 100027 China | 116.4616591 39.9602201

City Gate, Mahon, Cork, Ireland |

Am Kronberger Hang 2A, Schwalbach 65824, Germany | 8.5330088 50.1643734

168-172 Old Street, London EC1V 9BP, United Kingdom | -0.0905437 51.5251618

Ribera del Loira 8, Edificio Paris, Campo de las Naciones, Madrid 28042, Spain |

Via Spadolini, 5, Edificio A, Milano 20141, Italy |

2000 Bandra Kurla Complex, Bandra East, Mumbai, Maharashtra, 400051, IND |

625 Avenue of the Americas, New York, NY 10011, United States | -73.9949875 40.7402113

80 Quai Voltaire, Bezons Cedex 95876, France |

875 Howard St, San Francisco, CA 94103, United States | -122.4137689 37.774516

152 Teheran-ro, Seoul, 135, South Korea | 127.063216 37.5087407

1 Changi Business Park Central 1, #08-101, Changi City, Singapore 486036 |

207 Pacific Highway, St Leonards, Sydney, NSW, 2065, Australia | 151.1883288 -33.8245562

2-1-1 Yoyogi Shibuya-ku, Tokyo 151-0053, Japan |

1 Toronto Street, Toronto, Canada | -79.3759569 43.6500879

Edisonbaan 14b, Nieuwegein, Netherlands | 5.0963629 52.034968

(17 rows)

Page 58: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Second demo set • Pivotal is a spin-off from EMC and VMware

o Let‘s look after EMC addresses

• Yielded 196 addresses worldwide o Excluding USA (another test set)

o Excluding some addresses which not even Google Maps could resolve

Page 59: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

EMC has funny offices

© Google Maps

Page 60: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Second demo set • EMC addresses worldwide (non USA)

o 196 addresses in data set

o ArcGIS: 165 resolved

o OSM: 71 resolved

• OSM found 3 places which ArcGIS couldn‘t find

Page 61: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Second demo set • EMC addresses worldwide (non USA)

o 196 addresses in data set

o ArcGIS: 165 resolved (84%)

o OSM: 71 resolved (36%)

• OSM found 3 places which ArcGIS couldn‘t find

o 68 locations resolved from both services (34%)

• min distance: 6.7 meters

• max distance: 6177.34 meters (6.1 km)

• avg distance: 539.44 meters

• stddev: 1063.97 (wide spread)

Page 62: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

DEMO! • Lookup addresses (live/cached)

o EMC (cached)

Page 63: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

3rd & 4th data set • 3rd data set: EMC offices USA

o 216 addresses in total

o ArcGIS: 216 resolved (100%)

o OSM: 133 resolved (61%)

• 4th data set: Target shops USA o 1779 addresses in total

o ArcGIS: 1779 resolved (100%)

o OSM: 1205 resolved (67%)

Page 64: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

DEMO • Find nearest shop per office

Page 65: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Conclusion • ArcGIS:

o 100% resolve rate in USA

o 80% - 90% resolve rate outside the USA

• OpenStreetMap: o 60% - 70% resolve rate in USA

o Drops below 40% outside the USA

o Good data available where ArcGIS is weak

o In general more data available (if address found)

o Returned data is not formalized (returns whatever user entered for the

data point) – makes it hard to parse

Page 66: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Performance • Lookups happen per row

o In PostgreSQL, only one connection is serving the request -> everything is

serialized

o In Greenplum, every segment can do the lookup in parallel

Page 67: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Performance Greenplum

Standby

Segment Segment Segment Segment

Master

Master Server: Talks SQL to

the client

1 – n Segment Server: „hidden“ MPP

database

Row processing happens here, in parallel

Page 68: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Performance Greenplum

GP DB

GPDB Standard Module

27.5TB Data (Usable Physical Capacity Per module)

110TB Useable User Data Capacity per module, 4x compression)

Four 2U servers per module, each server contains: • 2 Sandybridge sockets/16

cores • 64GB Mem • 24x 900GB SAS 10K Drives

• 8 Segments per server

• 32 Segments per module

• 128 Segments per rack

• = 128 parallel requests

Page 69: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

What‘s next

Page 70: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Python • Add proper http headers

o Code already in ArcGIS module

• Better error handling

• Configuration o Code already there, only used in ArcGIS module

• Add pg_google module

Page 71: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

PostgreSQL • Packages

• More test data

• Test „Address Standardizer“

Page 72: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

ArcGIS • Integrate (some) paid services

o Route calculation

o Route plotting on map

Page 73: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

OpenStreetMap • Find a better service than „Nomination“

o MapQuest Resolver

o Photon

• Integrate routing service o Announced a few weeks ago

• Talk with the „Nominatim“ developers

Page 74: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Why did you not … • Integrate country-specific modules (like TIGER)

o Users don‘t care, they want the address resolved

o Certainly they don‘t care about specific countries

o But: I might implement it „under the hood“

• Google/Bing Maps o Working on it …

Page 75: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Questions • Will you upload the slides?

o http://andreas.scherbaum.la/ -> writings

Page 76: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Conferences • PostgreSQL Conference Europe 2015

o Vienna, Oct 27-30, conference, trainings

o http://2015.pgconf.eu/

• German-speaking PostgreSQL Conference 2015 o Hamburg, Nov 26-27, conference, trainings

o http://2015.pgconf.de/

Page 77: Resolving addresses to geocoordinates, using OpenStreetMap ... · Nearest shop/office • Retailers, banks and many others can figure out the closest shop or branch office for every

Thank you


Recommended