Location>code7788 >text

geocodeCN: a plugin for batch conversion of addresses to geographic coordinates

Popularity:47 ℃/2024-12-09 15:24:07

catalogs
  • 1. Introduction
  • 2. Steps for use:
    • 2.1 Installation
    • 2.2 Configuration
    • 2.3 Coordinate Matching
    • 2.4 Generating layers
    • 2.5 Export to CSV
  • 3. Description

1. Introduction

It's aQGISPlugin that is mainly used for batch geocoding, i.e. converting addresses to coordinates. It comes with its own user interface (GUI), which is ready to use out of the box, even if you don't know how to program.

It is characterized as follows:

  • Supports batch/individual conversion of addresses to coordinates

  • Support interfacing with different map platforms at home and abroad, Baidu Map, Gaode Map, OSM, Here, Mapbox.

  • Support coordinate conversion: Baidu coordinates --> WGS84, Baidu coordinates --> GCJ2000

  • Supports direct generation of QGIS layer previews

  • Support for exporting results to csv files

  • Supports proxy setting for some map services

2. Steps for use:

A prerequisite for using the plugin is that you must first install theQGIS, which is an open source GIS software that runs on theWindowsMacOSLinuxand other operating systems on top of it, it's powerful, and it's free to use, so anyone can get access to its code and then modify and distribute it.

2.1 Installation

The plugin has been released in the official QGIS plugin repository, and can be installed by looking for it directly in the repository, or by downloading the source package.

2.1.0 Installation via QGIS Plugin Repository

Go to menuPlugin >> Manage and Install Plugins

look for sth.geocodecnInstallation.

image-20241129233401416

2.1.1 Installation by downloading the zip archive.

leave forcode repositoryPage download zip archive

image-20241201141510531

2.1.2 Open the Plugin Management page in QGSI and click onInsall from ZIPSelect the zip file you downloaded in the previous step.

image-20240811023822744

strike (on the keyboard)installedCheck if the installation was successful

image-20240811024354440

2.2 Configuration

Configuration key required for first time useThen choose which one to useMap Services(Some map services need to configure the coordinate system, such as Baidu map), the key needs to go to the corresponding map service platform to register to get.

image-20241106234932211

Attention.: OSM map service can't be accessed normally because it is blocked in China, you need to do some special network configuration, if you have other proxy address, you can fill in and use it.

2.3 Coordinate Matching

1.Batch Matching

You need to save all the addresses to a CSV, then select it in the plugin, then specify which column in the table to use as theaddressMake a match.

id,address, name, prop1
1, xx street, xx district, xx city, xx province, xx university, 985
1, xx street, xx district, xx city, xx province, xx university, 211
1, xx street xx, xx district, xx city, xx province, xx university, none
1, xx street xx, xxx district, xx city, xx province, xx university, n/a
This is a reference CSV field format, there is no limit to how many fields, just make sure there is an address field in it

Attention.: The plug-in will automatically detect the encoding of the CSV, and if the detection result is not correct, the user needs to select the encoding manually.

image-20241106235141869

2. Single match

Enter the address in the address bar to match.

image-20241106235635927

2.4 Generating layers

strike (on the keyboard)Add to mapThis will generate a QGIS layer and write the other fields in the CSV to the layer attribute table.

Comparison of results for different coordinate systems

2.5 Export to CSV

strike (on the keyboard)export asExport the matches to a CSV file, and the plugin will add the matches on top of the original file, i.e. two new fields, one for longitude and the other for latitude.


3. Description

  • The accuracy of the address matching result relies on the open interface of the mapping platform, please refer to its official website for the specific accuracy.
  • Please use the plug-in in a compliant manner and make sure to follow the platform specifications while using the services of the mapping platform.
  • Match the address as detailed as possible, such as: xxx province/city/district xxx street xxx place, if not matched successfully, the plugin will automatically omit.
  • Baidu map coordinate conversion relies on anotheropen source library
  • Plugin part of the function is not yet realized, continue to update oh, welcome your code submission.