jpmesh (version 1.2.0)

coords_to_mesh: Convert from coordinate to mesh code

Description

From coordinate to mesh codes.

Usage

coords_to_mesh(longitude, latitude, 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)

mesh_size

Gives the unit in km for target mesh type. That is, 1 for 1km, and 0.5 for 500m. From 80km to 125m. Default is 1.

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

Run this code
# NOT RUN {
coords_to_mesh(141.3468, 43.06462, mesh_size = 1)
coords_to_mesh(139.6917, 35.68949, mesh_size = 0.250)
coords_to_mesh(139.71475, 35.70078)
# 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)))
# }

Run the code above in your browser using DataLab