How to get house number, street, postcode from a free-form address string
- Author Alfiya Tarasenko
- Published October 5, 2021
- Word count 832
If you have a service related to maps and addresses, parsing and standardizing become necessary for development. There are many difficulties in this process, so as ways of overcoming them. In this article, you’ll find the basics of standardization methods and a bit of detailed advice on choosing the right one.
What is Address Parsing?
When clients of your website enter their address, it will probably be presented as a stroke. To check if the address is correct and exists, this stroke must be divided into components. Also, all entered addresses must look the same. Different methods for proceeding with this operation are called parsing addresses from strings and standardizing them.
Why Is It Difficult?
The main problem is a human factor. People rarely enter their addresses the same way, and programs sometimes make it look like an unreadable combination with many classes.
Another difficulty is in many variants of addresses. Many countries have standards and many abbreviations meaning the same (does ‘St’ mean ‘Street’ or ‘Saint’?).
To help you solve this task, we collected and analyzed ways of how to process addresses. Here is a list of popular technologies below. They are listed from the most primitive to the most complicated and versatile ones.
1. RegEx Address Parser
Before you’ve read that, dealing with addresses with regular expressions is not effective. Still, it can be useful in some situations. For this method, you need a pattern with meta-symbols and symbols.
For example, a stroke looking like "NAME_FOR_CITY XX, NAME_FOR_STREET YY", and addresses in this format can be parsed like city: "NAME_FOR_CITY", postcode: "XX", street: "NAME_FOR_STREET", house number: "YY". Just select the regexp and find the preferable expression.
Compiling this method:
the most effective technology for strictly structured strings, when standardizing is not required;
no need to use external libraries or address parsing APIs;
completely ineffective with freeform addresses;
may cause performance, debugging, and maintenance problems.
NPM is a cross-platform package manager included in the Node.js system. On its website, you can search for external libraries for address parsing. They vary strongly and fit certain country postcodes, local specifics, and address standards.
For example, if you are processing Australian addresses, you should search for an Australian parsing package. Some popular ones are:
US Street Address Parser, that understands suffixes and abbreviations, 5 to 9 digit ZIP-codes, etc.;
Property Address Parser (addresser), that has a helpful function .getRandomCity to simplify testing;
humanparser, helping to deal with names, salutations, and prefixes, and also address parsing functions.
To work with each one, you should enter "npm install ".
Shortly summing up for this method:
convenient for local services;
difficult to find a 100% suitable library;
a license may not allow commercial usage.
3. Online Parsers and Validator
If you don’t standardize many addresses daily or have a small number of them, look at this useful online tool. It allows to parse, standardize, and verify addresses online in minutes.
The mechanism is quite simple:
A user uploads a file with addresses (it can be Text, Excel, or CSV).
Map components (street, city, state, and others).
Tap "Start" and wait until addresses get parsed with the Geocoding API technology.
Download standardized and verified addresses.
However, you cannot verify large packages of addresses this way.
4. Geocoding API
Now let’s look at the most versatile and strong instrument for working with locations. Geocoding API provides the full cycle of operations: parsing, postal address normalization, validation, and verification.
The Geocoding APIs purpose is to show the most suitable existing place for each one entered. It is much more than just parsing, allowing to save time and effort for developers and improve the quality of operations.
For example, let’s look at a service from Geoapify. A useful basic feature is providing the level of confidence for each location.
CONFIRMED — for fully correct existing addresses with all required information;
PARTIALLY_CONFIRMED — up to a certain level, the address is correct, but there are mistakes;
NOT_CONFIRMED — the location does not exist, and you’ll receive the most alike one instead.
Also, you’ll see all related information: coordinates, all address components - house number, street, city, postcode, etc., and standardized address. The address entered initially will be tested and parsed, and verified.
Summarizing this method:
provides the most checked and full information, requires almost no additional attention;
still, working with non-confirmed addresses needs additional work and logic from developers;
performs all needed operations and works versatile with most of the countries, multi-language support;
usually is not free for large datasets.
Which One is the Best?
All stated technologies are different and suit various situations. If you have many free-form addresses, choose the Geocoding API to match all purposes at once. For certainly local projects, NPM-packages and regular expressions are also great. Also, try different ways of working and find the preferable one.
Founder of Geoapify. We offer maps, geocoding, routing, and other APIs to help you to build location-aware apps.https://articlebiz.com
There are no posted comments.
- Top Benefits of PHP in Web Solution
- 5 Best Practices and 1 Tool for Mitigating Open-Source Vulnerabilities
- Can we book a hotel room for a few hours?
- Top 5 WooCommerce payment gateways
- WooCommerce in WordPress
- HOW TO OBTAIN MICROSOFT'S WINDOWS 11 UPGRADE FOR FREE(IF YOU'RE ELIGIBLE)
- Enhance Your Cross-Data SQL Capabilities with Database Workbench Pro
- Innovative Strategies for the Post-Pandemic Era
- Create Customized Desktop Productivity Shortcuts with QnE Companion
- Efficient Multi-Boot and Drive Partition Management with BootIt Collection
- Top 10 Sensors Types for Industrial Internet of Things
- Easily Convert and Open QuarkXPress Docs in Different Apps Using QXPMarkz
- 11 Graphic Designing Trends to Look Out For in 2021
- WordPress development: an agency or a freelance developer
- Why is owning a boat very expensive?
- Top 10 Grocery Delivery Mobile Apps in 2021
- What Does Cyclonis Password Manager Do to Protect Your Passwords?
- Essential Guide On Interlocking Plenum Armored Fiber Optic Cable
- Hikvision Thermal CCTV Cameras for Perimeter Security in SMEs
- Digital Onboarding and No-code Platforms
- 6 Myths of Charging Smartphones Batteries that are Wrong
- Photoshop Color Correction Service, Multi-color Photos from a single Photoshoot
- Darlox Electronic Limited: Fpc laminated structure
- The future development direction of artificial intelligence
- Smart Home Technology
- Monster Hunter World (MHW) Layered Armour
- Significance of Software testing services
- Berry Producer Finds More Value in SIMBA Than Expected.
- How to Find Phone With Cell Number - Find Out Who Your Partner is Calling Today!