OpenCage Geocoder πŸ‘‰πŸŒ Profile picture
Geocoding - Worldwide Β· Affordable Β· Reliable Β· Open Data β€’ API: https://t.co/hZbkLNFxE2 β€’ News: https://t.co/VWmxJZgp5v β€’ Mastodon: https://t.co/F10UclESZU

Oct 8, 2021, 10 tweets

Time to celebrate. πŸ₯³ We hit a nice milestone last week when @theHyphyDude submitted a pull request on our address-formatting project. The PR added a link to a #golang project that uses our templates.

So what is address-formatting?
github.com/OpenCageData/a…

πŸŒπŸ§΅πŸ‘‡

2/ Here's the problem: addresses all over the world are different. Different countries do things differently, and sometimes there are even differences within countries.

3/ Meanwhile the global OpenStreetMap community is continually collecting all kinds of data about the world, which is great. πŸ’ͺπŸ—ΊοΈ This can go to intense detail: every tree, park bench, foot path, etc. That's great, but ...

4/ When someone sends our API a geocoding request, we look in the database and see all kinds of stuff. We need to sift through it, and turn it into a well formatted address that matches the local way of presenting addresses that makes sense for that location.

5/ Sounds simple, but many services get it wrong. We call this the "Berlin, Berlin" bug. In the US πŸ‡ΊπŸ‡Έ it is normal to show <city>, <state>. In Germany πŸ‡©πŸ‡ͺ, Berlin is both a city and a state, but no one ever refers to "Berlin, Berlin". Only American services do that.

6/ Subtle i18n details like this add up to make a service feel natural and easy to use (or not).

When it's not right it's like the tiny stone in your shoe πŸͺ¨πŸ‘Ÿ that keeps annoying you.

address-formatting is our open source project to know how to make addresses look right

7/ the address-formatting project is a collection of templates that let us know how to display an address for each country/territory (248 in total) in the world 🌍

github.com/OpenCageData/a…

8/ The address-formatting templates themselves can be used in any programming language, with last week's PR adding #golang there are now 10 different parsers. πŸ₯³ Yeah, open source!

9/ most importantly we have hundreds of tests. We're always adding more, and welcome your suggestions. There is no shortage of global addressing edge cases.

You can see address-formatting in action in the "formatted" string in our geocoding API results

Hope you enjoyed this week's peek behind the curtain πŸͺŸ at life at a geocoding service.

We have many more geothreads about border disputes, exclaves, reverse geocoding, etc listed on our blog: blog.opencagedata.com/post/geothread…

Have questions? Get in touch.

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling