Geocoding R Package

R Package
Geocoding
An R package that provides geocoding, reverse geocoding, route planning, and advanced geographic visualization. Moreover, this package provides economic and social information such as nighttime lights and population based on geographic coding.
Author
Affiliation

Xinzhuo Huang

HKUST SOSC

Published

May 23, 2023

Modified

February 16, 2024

Overview

The Geocoding package provides functions for geocoding Chinese addresses.

The package is designed for researchers, analysts, and other users who need to work with Chinese address data.



Installation

remotes::install_github("xinzhuohkust/Geocoding")

Usage

geocoding

Geocoding::get_MCT("国家信访局") |>
  Geocoding::convert_MCT()
longitude latitude
116.358 39.919

reverse geocoding

Geocoding::get_MCT("国家信访局") |>
  Geocoding::get_admin_info(uid = TRUE)
district city province uid
西城区 北京市 北京市 871eebeac92224a8336212da

train planning

Geocoding::train_plan(
  origin = Geocoding::get_MCT("安徽省六安市裕安区") |> Geocoding::convert_MCT(),
  destination = Geocoding::get_MCT("国家信访局") |> Geocoding::convert_MCT(),
  sleep = 0.5,
  ak = "your ak"
)
starting city destination city duration price
六安市 北京市 7.850 483.5
六安市 北京市 6.467 457.0
六安市 北京市 11.117 222.5

Visualization

ggplot2 integration

Geocoding::plot_geocoding(
  data = "night",
  label = "jilin",
  year = "2022"
)

interactive map and 3D map (coming soon)