Ed Freyfogle, organiser of geospatial meetup Geomob, co-host of the Geomob podcast, and co-founder of the OpenCage, has offered to introduce a set of points around the topic of geocoding. His first entry starts a few paragraphs below on #topic".
Geocoding is translating between geo coordinates (latitude, longitude) and human place descriptions (addresses, placenames, etc). There are two kinds of geocoding:
- Forward geocoding: address to coordinates
- Reverse geocoding: coordinates to address
More smart phones and tracking devices means more geodata is being created than ever before. Geocoding is a first step in processing that data into useful information. In the coming weeks this series will look at the challenges around geocoding.
At OpenCage we run a highly available, simple to use, worldwide, geocoding API based on open datasets like OpenStreetMap. Have a project that will need geocoding? See our geocoding buyer's guide for an overview of all the factors to consider when choosing between geocoding services.
Proprietary geodata from private services like Google are widely used, but come with licenses that severely restrict how you can use the data. Restrictions include:
- don't allow storing (caching) beyond a certain time period, and require deletion when you stop being a customer
- limit which maps you can use to display the geodata
- require a significantly higher cost to use behind a firewall or in desktop software
- no clarity on when or if data will be refreshed or corrected
Open data, like that returned by the OpenCage geocoding API, means:
- store data as long as you like
- display on any map
- use publicly or behind a firewall
- fix errors when you find them
As a final bonus, because the data is free (no cost), our service is also much more affordable.
Have a project that will need geocoding? See our geocoding buyer's guide for an overview of all the factors to consider when choosing between geocoding services.
Good news: Open, global datasets like OpenStreetMap make getting lots geodata easier than ever.
Bad news: Now you have to sort through it, which can be an i18n nightmare.
Example: Given this geodata for a location in Spain - which address would a normal person expect?
"components": {
"ISO_3166-1_alpha-2": "ES",
"ISO_3166-1_alpha-3": "ESP",
"ISO_3166-2": [
"ES-CT",
"ES-B"
],
"_category": "building",
"_normalized_city" : "Barcelona",
"_type": "building",
"city": "Barcelona",
"continent" : "Europe",
"country" : "Spain",
"country_code" : "es",
"county" : "Barcelon\u00e8s",
"county_code" : "B",
"house_number" : "66-68",
"political_union" : "European Union",
"postcode" : "08017",
"province" : "Barcelona",
"quarter" : "les Tres Torres",
"road" : "Carrer de Calatrava",
"state" : "Catalonia",
"state_code" : "CT",
"suburb" : "Sarri\u00e0 - Sant Gervasi"
},
At OpenCage we’ve open-sourced the templates we use to convert address data into well formatted strings for the 240+ territories around the world, so we know the correct answer is Carrer de Calatrava, 66-68, 08017 Barcelona, Spain. This is just one of many small steps we’ve taken to make developer’s lives easier.
Anyone looking for an entertaining view of the technical complexity of addresses should read “Falsehoods programmers believe about addresses”. Meanwhile, in the category of not sure whether to laugh or cry, we have last year's news of the German town that voted “no” to adopting street names.
If your project calls for well-formatted addresses, give the OpenCage geocoding API a try.
Welcome to part four of our series on geocoding.
Given freely available opensource software, and open data like OpenStreetMap, should you run your own geocoder? Or should you pay a service like ours to host the geocoding software for you? The whole point of open data is that you can do it yourself, right?
The short answer is that yes, you can run, or even write, your own geocoder. Unqiue technical requirements may mean it makes sense to craft your own custom service, but most people prefer to leave it experts and get on with their real work.
Our geocoding API aggregates many different open data sources and provides enterprise level reliability. One factor we see many people overlook: setting up the software is one thing, keeping the underlying data current is another. Put another way: building is easy, maintaining is hard. OSM alone gets 4-5 million edits per day. Still, as a developer myself and long-time OSM contributor, I understand the inclination to get your hands dirty. Hopefully it helps put you at ease to know that we’re doing our part to give back to the open data and open source geo software community.
Finally, rest easy knowing that if you ever need to the data and code is all there for you to dive into. That’s the real power of open-source and open data.
Have a project that will need geocoding? See our geocoding buyer's guide for an overview of all the factors to consider when choosing between geocoding services.
Most data projects involve tedious cleaning and enriching before the data can actually be "used".
At OpenCage, we are firm believers that laziness is one of the virtues of a great developer. We’ve thought a lot about making geocoding with open data dead simple, but also how to simplify the total journey to using the data. Our geocoding API returns "annotations" - extra information about the location that developers might find useful, thus saving work.
An example is EU NUTS codes, standard codes commonly used for linking datasets and statistical analysis. Looking up the relevant codes for a region is not particularly complex, but it is the kind small tasks that need to be done correctly (and maintained) in a larger data processing project. So, as a simplification for our users, we already return the correct codes as an annotation.
As an example, a request to the OpenCage geocoder for 52.387, 9.733 (in northern Germany) returns the annotation
"NUTS": {
"NUTS0": {
"code": "DE"
},
"NUTS1": {
"code": "DE9"
},
"NUTS2": {
"code": "DE92"
},
"NUTS3": {
"code": "DE929"
}
},
We also return many other types of information, for example: the local timezone, calling code, currency information, other reference systems like geohash, what3words, MGRS, US FIPS cdes, Maidenhead, the time of sunrise and sunset, the qibla angle, and much more.
Have a project that will need geocoding? See our geocoding buyer's guide for an overview of all the factors to consider when choosing between geocoding services.
In our final installment in our series about using open data for geocoding we contemplate the challenges of geocoding at scale. What are the issues you face when you have many hundreds of thousands or even millions of coordinates or addresses to work on daily? At OpenCage we serve numerous customers in this category, and a common question that comes up is whether an API based solution can handle that type of scale.
An API-based solution, managed by experts, is almost always the most reliable and most affordable way to develop such an on-going system, as otherwise you will soon be spending a lot of valuable developer time making sure your geodata is staying current. As anyone who has worked with software can confirm: “Building is easy, maintaining is hard”.
Nevertheless, there are challenges that come with depending on any external service, one of course being network availability. At OpenCage we have multiple, fully-redundant data centers, and the availability of our service is independently and publicly monitored by a third party (current and past operational status can be seen at status.opencagedata.com).
Still, even with a highly-available service, some customers worry about the “cost” of crossing the internet to an external service. The fastest API query is the one you don’t even make; a smart caching strategy can go a long way to reducing usage. Because our geocoding API is built on open data you can cache the results as long as you like, and we’ve published a few tips and points to consider.
We hope you’ve enjoyed our series on the issues around geocoding with open data. While we’ve used our service as the example, we believe many of the concepts and considerations will apply regardless of the data processing tools and services you are building on. If you have questions regarding anything we discussed, please get in touch.
Have a project that will need geocoding? See our geocoding buyer's guide for an overview of all the factors to consider when choosing between geocoding services.