coords_to_mesh: Convert from coordinate to mesh code

Description Usage Arguments Value References See Also Examples

View source: R/coords_to_mesh.R

Description

From coordinate to mesh codes.

Usage

1
coords_to_mesh(longitude, latitude, to_mesh_size = 1, geometry = NULL, ...)

Arguments

longitude

longitude that approximately to .120.0 to 154.0 (double)

latitude

latitude that approximately to 20.0 to 46.0 (double)

to_mesh_size

target mesh size. That is, 1 for 1km, and 0.5 for 500m. From 80km to 0.100km.

geometry

XY sfg object

...

other parameters

Value

mesh code (default 3rd meshcode aka 1km mesh)

References

Akio Takenaka: http://takenaka-akio.org/etc/j_map/index.html # nolint

See Also

mesh_to_coords() for convert from meshcode to coordinates

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
coords_to_mesh(141.3468, 43.06462, to_mesh_size = 1)
coords_to_mesh(139.6917, 35.68949, to_mesh_size = 0.250)
coords_to_mesh(139.71475, 35.70078)
coords_to_mesh(139.71475, 35.70078, to_mesh_size = 0.1)
coords_to_mesh(c(141.3468, 139.71475), 
               c(43.06462, 35.70078), 
               mesh_size = c(1, 10))
# Using sf (point as sfg object)
library(sf)
coords_to_mesh(geometry = st_point(c(139.71475, 35.70078)))
coords_to_mesh(geometry = st_point(c(130.4412895, 30.2984335)))

jpmesh documentation built on Jan. 10, 2022, 9:07 a.m.