What is Geocoding?
Have you ever use a map application, searched for an address and then been shown a pin for where that address is? Have you ever wondered how the map “knew” where your home is?
An address like “130 Renee Ct, Roswell, GA 30075, United States” is just text, a computer can’t really understand it and a map certainly doesn’t know where it is.
Mapping applications solve this problem with a tool known as a geocoder. The purpose of a geocoder is to convert address data into location data. This process is known as geocoding. Sometimes, we also need to convert location data into address data, a process known as reverse geocoding.
A location is a set of coordinates which identify a place, set of places, or space on the earth. By far, the most common system used is WGS84, which uses a latitude and longitude to uniquely identify a location on the earth. An example would be (51.499981147, -0.141166242).
Forward Geocode
Section titled “Forward Geocode”Forward geocoding is the process of taking an address as a single string and looking up its associated geographic data. For example, we might search for “32 Thames St, Windsor SL4 1PS” to find its associated coordinates, and in the case of Naurt, building entrance and parking information.
It’s also possible to do what Naurt calls a parsed search. If we look at the address “32 Thames St, Windsor SL4 1PS” again, we can see that this is a single piece of information. However, the address is actually composed of parts. Naurt defines this as
- Street number: 32
- Street name: Thames St.
- City: Windsor
- Postcode: SL4 1PS
Doing a parsed search like this is possible, but Naurt actually has a parser which can convert a single address into this parsed data for you, which means you don’t need to worry about performing a parsed search yourself.
It’s also possible to bias a forward geocode search with a location, too. For example “12 Main Road” is not a very helpful search since there are many “12 Main Road” in the world. However, if we said “12 Main Road” near (51.42, 0.56) you know it has to be the Main Road in Rochester.
Use Cases
Section titled “Use Cases”- A user wanting to know the location for a specific restaurant
- A delivery driver needing to know which location to deliver a parcel to based on a written address.
Reverse Geocoder
Section titled “Reverse Geocoder”A reverse geocode gives nearby results to a location. For example, the closest 5 addresses to (52.375139, -1.265995) are
- Flat 1, 99 Oliver Street, Rugby, CV21 2LF, United Kingdom
- Flat 2, 99 Oliver Street, Rugby, CV21 2LF, United Kingdom
- 56 Dale Street, Rugby, CV21 2LP, United Kingdom
- 78 Oliver Street, Rugby, CV21 2LE, United Kingdom
- Flat 3, 99 Oliver Street, Rugby, CV21 2LF, United Kingdom
Use Cases
Section titled “Use Cases”The best use case for reverse geocoding is map exploring. When a user is presented with a map, they may wish to know what is nearby. If they want to be able to click on the map to see nearby addresses, this is the perfect use case for reverse geocode. You can actually see this in our own dashboard!
How does Naurt’s Geocoder Work?
Section titled “How does Naurt’s Geocoder Work?”Our geocoder is based around a central database which contains our available address data. Having a database with a large amount of information provides flexibility - all our search products are variations on how to access this data.
Here’s some of the things that Naurt’s geocoder can provide, beyond just the standard feature of converting an address to location or vice versa.
Standardisation
Section titled “Standardisation”When an address is inputted into the geocoder it could be in any format, so it needs to be standardised. First, the address is parsed including detecting the language, expanding any common abbreviations such as cl into the full word, close, and removing any invalid characters. Naurt also reformats any address into the best standard used in the relevant region. In the UK, for example, addresses have the format street number, street name as in, “99 Upper Lewes Road”. However in Estonia, it would be written street name, street number, as in “Upper Lewes Road, 99”. Naurt will automatically handle this for you.
Verification
Section titled “Verification”Some services provide “address validation” which verify that an address exists (not to be confused with AVS or Address Verification Services from credit card companies). Naurt implicitly provides a service which validates that an address exists - all Naurt addresses are checked against trusted third party providers. If a successful match is made against Naurt’s database, the address exists.
Parsing
Section titled “Parsing”Sometimes you will want the address broken down into constituent components i.e. converting from “35 Clarendon Road, Croydon” into
- Street number: 35
- Street name: Clarendon Road
- City: London
- Locality: Croydon
- Postcode: CR0 3SJ
- State: England
- Country: United Kingdom
Naurt will use the full address components, including those not found in the original search string and also those not found in the display address (for instance, in the UK, “England” is rarely use in an address, but will appear in the state field)