Learn R Programming

jpndistrict

Overview

In this package, the administrative area data to be provided uses the National Land Numerical Information. Shinya Uryu is editing and processing this data. Therefore, when preparing a secondary work using this data, it is necessary to follow the term of the National Land Numerical Information.

This package provide map data is based on the Digital Map 25000 (Map Image) published by Geospatial Information Authority of Japan (Approval No.603FY2017 information usage https://www.gsi.go.jp).

Installation

Install from CRAN.

install.packages("jpndistrict")

For developers, please use the devtool package to install via the GitHub repository.

install.packages("remotes")
remotes::install_github("uribo/jpndistrict")

Usage

# Load Package
library(jpndistrict)

Administrative area data

jpn_pref(14)
jpn_pref(14, district = FALSE)
jpn_cities(14, admin_name = "海老名市")
jpn_cities(33, admin_name = c("倉敷市", "笠岡市"))
# Return mesh polygons included in administrative areas.
mesh_district(jis_code = "05")
mesh_district(jis_code = 33101)

Administration office data

jpn_admins(jis_code = 33)
jpn_admins(jis_code = c("33101", "33212"))

Reverse geocoding in prefecture and city level

find_pref(longitude = 133.915, latitude = 34.666)
find_city(longitude = 133.915, latitude = 34.666)
# sfg
find_city(geometry = sf::st_point(c(140.112, 36.083)))

City name and code validation

code_validate(jis_code = 33101)
code_reform(jis_code = c(1, "33", "08201"))

Copy Link

Version

Install

install.packages('jpndistrict')

Monthly Downloads

165

Version

0.3.9

License

MIT + file LICENSE

Maintainer

Last Published

December 8th, 2020

Functions in jpndistrict (0.3.9)

collect_cityarea

Collect administration area
find_city

Detect city by coordinates
find_jis_code

Find JIS city code
code_reform

Reform input jis code as 2 or 5 character length.
collect_ksj_p34

Collect administration office point datasets.
find_prefs

Detect prefectures by coordinates
district_viewer

District Viewer
code_validate

Administration code validation
%>%

Pipe operator
jpn_admins

Simple features for administration office points
mesh_district

Export district's mesh polygon
path_ksj_cityarea

Download KSJ N03 zip files
read_ksj_p34

Intermediate function
jpnprefs

Prefectural informations in Japan
which_pol_min

Internal function
jpn_pref

Simple features for prefecture area polygon
jpn_cities

Simple features for city area polygons
raw_bind_cityareas

Intermediate function
read_ksj_cityarea

Intermediate function
prefecture_mesh

Prefecture's meshcode
collect_prefcode

Get prefecture code (JIS X 0402)
find_pref

Detect prefecture by coordinates