How to get house number, street, postcode from a free-form address string
Computers & Technology → Technology
- 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.
2. NPM-packages
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://www.geoapify.com/geocoding-api/
Article source: https://articlebiz.comRate article
Article comments
There are no posted comments.
Related articles
- Free Test Management Tools: Top Picks for QA 2025
- How Bullseye Engagement’s Competency Tracking Software Enhances Workforce Performance
- Lesson Management Systems: Shaping the Future of K-12 Schools
- What Are the Features and Tech Stack of Web3 Game in UAE?
- Artsyl Technologies Recognized Among Top Performers in Accounts Payable Automation
- The Role of 5G and Advanced Networks in the United States: Bridging the Digital Divide
- ADA Price Prediction: What Experts Say About Cardano's Future Value
- The Rise of Software to Monitor Employee Computer Activity: Balancing Productivity, Privacy, and Ethics
- Electronic Document Management System: Efficiency and Challenges in the Digital Age
- Why Shift Scheduling Matters: How to Optimize Labor Costs in Business Central
- Green Banking Market: Trends and Opportunities by 2030
- Troubleshooting Common Windows Server Issues: IT Support Services in London for SMBS
- Freight Price Rules in Business Central for Transparent Shipping Costs
- Unlocking the Power of AI: How Artificial Intelligence is Revolutionizing Business Operations
- Top 10 AI Resume Builders for 2025
- How AI-Powered Accounting Software Saves Small Businesses Time and Money
- How to Optimize Your Practice with Healthcare Revenue Cycle Management Solutions
- How Biomethane Aligns Decarbonisation with Circular Economies
- How a Yes No Oracle Can Streamline Your Decision-Making Process
- The Essential Guide to Desktop Hard Drives
- 10 Tips to Maximize Efficiency in Business Central with Maintenance Manager
- Lean Analytics: A Practical Study Guide for Data-Driven Decisions
- Bitcoin Mining Hardware vs. Cloud Mining: Which Option Makes More Sense?
- HIRE A GENUINE CRYPTO RECOVERY SERVICE TO RECOVER FROM FRAUDLENT PLATFORMS; CYBERPUNK PROGRAMMERS
- How to Safeguard Your Tech Infrastructure Against Supply Chain Attacks
- psychophysical space time
- Top Mobile Application Development Company | Expert App Solutions
- Why Modern Businesses in Australia Need an AngularJS Development Company in 2025
- Reaching For The Skies! CNC Machining In Aerospace
- AI-Powered Content Generators: What Are the Opportunities and Challenges?