Difference between revisions of "Geocoding and Reverse Geocoding Addresses in QGIS"

From CUOSGwiki
Jump to navigationJump to search
Line 43: Line 43:
 
* We should see the following pop-up:
 
* We should see the following pop-up:
 
[[File:data4.PNG]]
 
[[File:data4.PNG]]
  +
In the Input CSV File field, we will use our selectee data set of restaurants. Make sure the Address, City, State, and Country fields align correctly with their respective column in the Excel sheet. The Web Service we will use is OpenStreetMap / Nominatim, make sure that this field is correct. In the Output File Field, choose an appropriate name for the resulting shapefile to be stored as, and save it in your working folder. The Not Found Output List field is a list of every address that could not be geocoded. Save it in your working folder. Once all of your field are correctly filled, hit Apply.

Revision as of 19:50, 14 December 2021

Introduction

Geocoding is the computational process by which a text-based, physical address is converted into geographic coordinates, which can be used for a variety of mapping applications. Geocoding requires a reference dataset and a geocoding algorithm, each of which is composed of sub-operations and sub-components that work together to transform physical, input data into numerical, spatial data. Reverse geocoding is the process by which geographic coordinates are converted into a physical address.

Why Geocode?

Geocoding allows us to quickly find various types of locations, including historical buildings, houses, restaurants, and stores. From simple data analysis to business and customer management and distribution techniques, there is a wide range of applications geocoding can be used for, as we can identify and analyze patterns within the data. With geocoded addresses, you can spatially display the address locations and begin to recognize patterns within the information.

Geocoding software is implemented in a variety of industries, including but not limited to:

  • Health: assess patient access to healthcare facilities; study epidemiological patterns of a disease
  • Finance: determine lending activity in the community, including demographics data to assist in fair lending efforts
  • Public Safety: direct emergency response via locally developed street files and E911 points
  • Military: Military Grid Reference System (MGRS) is the geocoordinate standard used by NATO militaries
  • Commercial: directly factor geography into the business analytics process; monitor shipping patterns and customer sales

Data and Software

QGIS offers several plugins on how to translate a list of addresses to coordinates on a map, or vice versa. We will be using a plugin called MMQGIS to simulate the following theoretical problem: we want to know locate the most popular Mexican restaurants around Ottawa so we can choose the best place to open our new restaurant. The data used for this tutorial was gathered by compiling the first 20 results of a Google maps search of local Mexican restaurants. Their addresses were collected and formatted in an Excel file, available HERE.

QGIS 3.22 download available at: https://www.qgis.org/en/site/forusers/download.html

Data Format

  • Note: Only relevant if you are using your own data.

Before you get started with geocoding using QGIS, make sure that your addresses are stored in a CSV/Excel file that is formatted for UTF-8. The addresses should follow this format: Name (optional), Street Address, City, State/Province, Country

Data6.PNG

Installing MMQGIS

MMQGIS is a set of Python plugins for manipulating vector map layers in Quantum GIS: CSV input/output/join, geocoding, geometry conversion, buffering, hub analysis, simplification, column modification, and simple animation. MMQGIS provides an alternative to the Processing toolbox, with verbose progress reporting, an intuitive user interface, direct shapefile/CSV-file access, and some additional capabilities missing from other plugin sets (QGIS Plugins Repository). MMQGIS is a solid choice for geocoding because it allows for a large number of addressed to be geocoded at the same time, and also supports multiple web services for geocoding (Google Maps, OpenStreetMap, US Census Bureau, ESRI Server).


  • To install MMQGIS, first select Plugins -> Manage and Install Plugins.

Data1.PNG

  • Next, begin searching for "MMQGIS" in the search bar, it should be the first one to pop up. Select Install Plugin.

Data2.PNG

Geocoding the Addresses

Now that we have our data set, and the plugin installed, we are ready to start geocoding.

  • Under the MMQGIS tab, pan down to Geocode -> Geocode CSV with Web Service.
Data3.PNG
  • We should see the following pop-up:

Data4.PNG In the Input CSV File field, we will use our selectee data set of restaurants. Make sure the Address, City, State, and Country fields align correctly with their respective column in the Excel sheet. The Web Service we will use is OpenStreetMap / Nominatim, make sure that this field is correct. In the Output File Field, choose an appropriate name for the resulting shapefile to be stored as, and save it in your working folder. The Not Found Output List field is a list of every address that could not be geocoded. Save it in your working folder. Once all of your field are correctly filled, hit Apply.