Nothing Special   »   [go: up one dir, main page]

Package 'geocn'

Title: Loads Spatial Data Sets of China
Description: Providing various commonly used spatial data related to Chinese regions in the R programming environment.
Authors: Wenbo Lv [aut, cre]
Maintainer: Wenbo Lv <[email protected]>
License: GPL-3
Version: 0.2.0
Built: 2024-10-06 09:15:41 UTC
Source: https://github.com/stscl/geocn

Help Index


List all data sets available in the geocn package

Description

Returns a tibble with all datasets available in the geocn package.

Usage

list_geocn()

Value

A tibble

Examples

list_geocn()

Loading the commonly used Albers Lambert projection in China region.

Description

Loading the commonly used Albers Lambert projection in China region.

Usage

load_cn_alberproj(output = "sf")

Arguments

output

(optional) Output format, must be sf or terra. Default is sf.

Value

An Available Projection CRS.

Examples

load_cn_alberproj()

Loading China's Land Border Line and the 10-dash line of the South China Sea

Description

Loading China's Land Border Line and the 10-dash line of the South China Sea

Usage

load_cn_border()

Value

An sf object

Examples

cn_border = load_cn_border()
cn_border

Loading Chinese City-Level Administrative Division Polygon Data

Description

Loading Chinese City-Level Administrative Division Polygon Data

Usage

load_cn_city(simplify = TRUE, keep = 0.05, keep_shape = TRUE, ...)

Arguments

simplify

(optional) Whether to simplify loading sf objects (default TRUE)

keep

(optional) Proportion of points to retain (0-1; default 0.05)

keep_shape

(optional) Prevent small polygon features from disappearing at high simplification (default TRUE)

...

(optional) Other arguments passed to rmapshaper::ms_simplify()

Value

Whether to simplify loading sf objects

Examples

library(sf)
city = load_cn_city()
city

Loading Coastline of China

Description

Loading Coastline of China

Usage

load_cn_coastline()

Value

An sf object

Examples

cn_coastline = load_cn_coastline()
cn_coastline

Loading Chinese County-Level Administrative Division Polygon Data

Description

Loading Chinese County-Level Administrative Division Polygon Data

Usage

load_cn_county(simplify = TRUE, keep = 0.05, keep_shape = TRUE, ...)

Arguments

simplify

(optional) Whether to simplify loading sf objects (default TRUE)

keep

(optional) Proportion of points to retain (0-1; default 0.05)

keep_shape

(optional) Prevent small polygon features from disappearing at high simplification (default TRUE)

...

(optional) Other arguments passed to rmapshaper::ms_simplify()

Value

Whether to simplify loading sf objects

Examples

library(sf)
county = load_cn_county()
county

Loading China's Land Border

Description

Loading China's Land Border

Usage

load_cn_landborder()

Value

An sf object

Examples

cn_landborder = load_cn_landborder()
cn_landborder

Loading China's Land Border and Coastline

Description

Loading China's Land Border and Coastline

Usage

load_cn_landcoast()

Value

An sf object

Examples

cn_landcoast = load_cn_landcoast()
cn_landcoast

Loading Chinese Province-Level Administrative Divisional Polygon Data

Description

Loading Chinese Province-Level Administrative Divisional Polygon Data

Usage

load_cn_province(simplify = TRUE, keep = 0.05, keep_shape = TRUE, ...)

Arguments

simplify

(optional) Whether to simplify loading sf objects (default TRUE)

keep

(optional) Proportion of points to retain (0-1; default 0.05)

keep_shape

(optional) Prevent small polygon features from disappearing at high simplification (default TRUE)

...

(optional) Other arguments passed to rmapshaper::ms_simplify()

Value

Whether to simplify loading sf objects

Examples

library(sf)
province = load_cn_province()
province

Loading the 10-dash line of the South China Sea

Description

Loading the 10-dash line of the South China Sea

Usage

load_cn_tenline()

Value

An sf object

Examples

cn_tenline = load_cn_tenline()
cn_tenline

Loading the Boundary Polygon Data of Loess Plateau

Description

Loading the Boundary Polygon Data of Loess Plateau

Usage

load_loess_plateau()

Value

An sf object

Examples

load_loess_plateau()

Loading the Boundary Polygon Data of Tibetan Plateau

Description

Loading the Boundary Polygon Data of Tibetan Plateau

Usage

load_tibetan_plateau()

Value

An sf object

Examples

load_tibetan_plateau()

Loading the Boundary Polygon Data of Weihe River Basin

Description

Loading the Boundary Polygon Data of Weihe River Basin

Usage

load_weihe_basin()

Value

An sf object

Examples

load_weihe_basin()

Loading Global Coastlines

Description

Loading Global Coastlines

Usage

load_world_coastline()

Value

An sf object

Examples

load_world_coastline()

Loading Global Continents

Description

Loading Global Continents

Usage

load_world_continent()

Value

An sf object

Examples

load_world_continent()

Load Global Country Boundaries

Description

Load Global Country Boundaries

Usage

load_world_country(center = "west")

Arguments

center

(optional) Center must be west or east. Default is west.

Details

When the center parameter is set to west, the map center is the Atlantic Ocean; and when center is ⁠east,⁠ the map center is the Pacific Ocean.

Value

An sf object

Examples

load_world_country()

Loading Global Lakes

Description

Loading Global Lakes

Usage

load_world_lake()

Value

An sf object

Examples

load_world_lake()

Loading Global Oceans

Description

Loading Global Oceans

Usage

load_world_ocean()

Value

An sf object

Examples

load_world_ocean()

Loading Global Rivers

Description

Loading Global Rivers

Usage

load_world_river()

Value

An sf object

Examples

load_world_river()

Loading the Boundary Polygon Data of Yangtze River Basin

Description

Loading the Boundary Polygon Data of Yangtze River Basin

Usage

load_yangtze_basin()

Value

An sf object

Examples

load_yangtze_basin()

Loading the Boundary Polygon Data of Yellow River Basin

Description

Loading the Boundary Polygon Data of Yellow River Basin

Usage

load_yellow_river_basin()

Value

An sf object

Examples

load_yellow_river_basin()

Coordinate Conversion Between GCJ02,BD09 and WGS84

Description

Coordinate Conversion Between GCJ02,BD09 and WGS84

Usage

st_transform_cn(lon, lat, from = "gcj", to = "wgs")

Arguments

lon

Longitude vector.

lat

Latitude vector.

from

(optional) Source CRS. Default is gcj.

to

(optional) Target CRS. Default is wgs.

Details

wgs stands for WGS84 coordinate system, gcj stands for GCJ02 coordinate system, and bd stands for BD09 coordinate system.

Value

A coordinate tibble in the target CRS.

Examples

lon = c(126.626510,126.625261,126.626378,126.626541,126.626721,126.627732,126.626510)
lat = c(45.731596,45.729834,45.729435,45.729676,45.729604,45.730915,45.731596)
st_transform_cn(lon,lat)