Package 'kuniezu'

Title: Assistance on the National Geography of Japan
Description: Data set on Japan's national geography. Provides tools for efficient processing and visualization of unique coordinate systems.
Authors: Shinya Uryu [aut, cre] , Geospatial Information Authority of Japan [cph] (Author of Global Map Japan Data)
Maintainer: Shinya Uryu <[email protected]>
License: MIT + file LICENSE
Version: 0.1.2.9000
Built: 2024-08-21 04:46:17 UTC
Source: https://github.com/uribo/kuniezu

Help Index


The extreme points of Japan

Description

A list of the east, west, south and north ends of Japan's territory (including remote islands). The northernmost position is what the government claims.

Usage

extreme_points

Format

A four length list consisting of sfc

See Also

https://www.gsi.go.jp/KOKUJYOHO/center.htm

Examples

extreme_points

extreme_points$east

require("purrr")
extreme_points %>%
  reduce(c)

Drawing a segment line segment that shows the boundary

Description

Drawing a segment line segment that shows the boundary

Usage

geom_jpsegment(...)

Arguments

...

other arguments passed on to geom_segment.

Value

ggplot object and plot

See Also

move_jpn_rs

Examples

require("ggplot2")
require("sf")
move_jpn_rs(jgd2011_bbox) %>%
  ggplot() +
  geom_sf() +
  geom_jpsegment()

Add a tile layer from GSI

Description

Add a tile layer from Geospatial Information Authority of Japan (GSI).

Usage

gsi_tiles

Format

A 48 length, leaflet objects.

Details

Stores map tiles that can be used with leaflets. Please follow the terms and conditions of use for the applicable tile at https://maps.gsi.go.jp/development/ichiran.html when using it. It contains tiles that can be used as base maps for interactive maps based on leaflet. See example section its use in leaflet. To use a mapview, a tile name is given to mapview::mapview(map = ).

Examples

names(gsi_tiles)
require("leaflet")
gsi_tiles[[1]]

gsi_tiles[[1]] %>%
  addCircles(
    data = sf::st_transform(extreme_points %>%
      purrr::reduce(c),
      crs = 4326))

JGD2011 / Japan Plane Rectangular CS

Description

Japanese Geodetic Datum 2011

Usage

jgd2011_bbox

Format

A sf (CRS EPSG:6668) with 19 rows 3 variables:

  • system

  • epsg

  • geometry

Value

sf

Author(s)

Original polygon data copyright is the Geospatial Information Authority of Japan; compiled for R by Shinya Uryu.

References

Global Map Japan https://www.gsi.go.jp/kankyochiri/gm_jpn.html. Created by processing Global Map Japan.

Examples

require("sf")
jgd2011_bbox

Japan Prefectural Goverment Offices

Description

Locations of 47 government offices in Japan's prefectures.

Usage

jp47prefectural_offices

Format

A sf contains 2 column and 47 rows.

Details

The original file was downloaded from https://www.gsi.go.jp/KOKUJYOHO/center.htm, which parses the PDF data and organizes the coordinates of the prefectural hall.

Examples

require("sf")
jp47prefectural_offices

Clip and move some geometries for mapping

Description

Move geometry differently from the real-life arrangement for mapping. When displaying a map showing Japan, the southern islands are sometimes moved. To achieve this, we need to perform false operations on the geometry.

Usage

move_jpn_rs(data, clip = TRUE)

Arguments

data

sf that records the prefecture or municipality of Japan

clip

An option to hide isolated island that are separated from other geometry and have a small area.

Value

sf. Geometry in Tokyo may have rows duplicated in Honshu and islands.

Examples

require("sf")
move_jpn_rs(jgd2011_bbox)

Parse longitude and latitude values in DMS

Description

Parse longitude and latitude values in DMS

Usage

parse_lon_dohunbyo(longitude)

parse_lat_dohunbyo(latitude)

Arguments

longitude

longitude values

latitude

latitude values

Value

numeric vector

Examples

x <- "\u6771\u7d4c139\u5ea644\u520628\u79d28869"
parse_lon_dohunbyo(x)
y <- "\u5317\u7def35\u5ea639\u520629\u79d21572"
parse_lat_dohunbyo(y)

Replace Kanji in degrees, minutes, and seconds with symbols

Description

Replace Kanji in degrees, minutes, and seconds with symbols

Usage

replace_dohunbyo_kanji(x)

Arguments

x

character

Value

character vector

Examples

x <- "\u6771\u7d4c139\u5ea644\u520628\u79d28869"
replace_dohunbyo_kanji(x)
y <- "\u5317\u7def35\u5ea639\u520629\u79d21572"
replace_dohunbyo_kanji(y)

Identify the Japan plane rectangular CS

Description

Returns the value when the coordinates of ESPG:4326 given to the input are replaced with those of the Japan Plane Rectangular CS.

Usage

st_nearest_jgd2011(geometry)

st_detect_jgd2011(geometry)

Arguments

geometry

geometry (POINT, EPSG:4326)

Details

  • st_nearest_jgd2011(): It returns the coordinate system closest to the given ground object. This is valid even when the coordinates are at sea.

  • st_detect_jgd2011(): Identify the coordinate system in which the given object is located.

Value

numeric vector

See Also

https://www.gsi.go.jp/LAW/heimencho.html

Examples

require("sf")
p <-
  st_sfc(sf::st_point(c(140.77, 36.8)), crs = 4326)
st_nearest_jgd2011(p)

st_detect_jgd2011(p)
st_detect_jgd2011(st_sfc(sf::st_point(c(140.73, 36.8)), crs = 4326))