Package 'mapchina'

Title: China Administrative Divisions Geospatial Shapefile Data
Description: Geospatial shapefile data of China administrative divisions to the county/district-level.
Authors: Mingchu Xu [aut, cre]
Maintainer: Mingchu Xu <[email protected]>
License: GPL-3
Version: 0.1.0
Built: 2025-02-12 04:11:00 UTC
Source: https://github.com/xmc811/mapchina

Help Index


China administraive division shapefile data

Description

A simple feature dataframe of China administrative divisions. The data was originally queried from OpenStreetMap and manually corrected for errors in QGIS

Usage

china

Format

A simple feature dataframe of China administrative divisions

Code_County

Code of county-level administrative division.

Code_Perfecture

Code of perfecture-level administrative division.

Code_Province

Code of province-level administrative division.

Name_Province

Chinese name of province-level administrative division.

Name_Perfecture

Chinese name of perfecture-level administrative division.

Name_County

Chinese name of county-level administrative division.

Pinyin

Chinese Pinyin.

Pop_2000

Population in Year 2000.

Pop_2010

Population in Year 2010.

Pop_2017

Estimated population in Year 2017.

Pop_2018

Estimated population in Year 2018.

Area

Land area in square km.

Density

Population density in every square km.

Geometry

vector geometry of the administrative division.

Source

<https://www.openstreetmap.org/> <http://www.mca.gov.cn/article/sj/xzqh/1980/2019/202002281436.html>

Examples

head(china)

Generate map colors by greedy coloring algorithm so that bordering features are colored differently

Description

Generate map colors by greedy coloring algorithm so that bordering features are colored differently

Usage

generate_map_colors(sf)

Arguments

sf

An simple feature dataframe - the shapefile of investigation

Value

An integer vector - the indices of map colors

Examples

generate_map_colors(head(china, 10))

Get the mex number of a vector

Description

Get the mex number of a vector

Usage

get_mex(v, colors, idx)

Arguments

v

An logical vector - the intersection vector

colors

An integer vector - the color assignment vector

idx

An integer - the index

Value

An integer

Examples

get_mex(c(TRUE,TRUE,FALSE,FALSE,TRUE), 1:5, 4)