Return different meshcode values included in the mesh.
mesh_convert(meshcode = NULL, to_mesh_size = NULL)
character
. mesh code
target mesh size. That is, 1 for 1km, and 0.5 for 500m. From 80km to 0.100km.
If NULL
for to_mesh_size, the meshcode of one small
scale will be returned. If it is the same as the original size,
the meshcode of the input will be return.
mesh_convert(meshcode = "52350432", to_mesh_size = 80)
#> <meshcode[1]>
#> [1] 5235
mesh_convert("52350432", 10)
#> <meshcode[1]>
#> [1] 523504
# Scale down
mesh_convert("52350432", 0.500)
#> <meshcode[4]>
#> [1] 523504321 523504322 523504323 523504324
mesh_convert("52350432", 0.250)
#> <meshcode[16]>
#> [1] 5235043211 5235043212 5235043213 5235043214 5235043221 5235043222
#> [7] 5235043223 5235043224 5235043231 5235043232 5235043233 5235043234
#> [13] 5235043241 5235043242 5235043243 5235043244
mesh_convert(meshcode = "52350432", 0.125)
#> <meshcode[64]>
#> [1] 52350432111 52350432112 52350432113 52350432114 52350432121 52350432122
#> [7] 52350432123 52350432124 52350432131 52350432132 52350432133 52350432134
#> [13] 52350432141 52350432142 52350432143 52350432144 52350432211 52350432212
#> [19] 52350432213 52350432214 52350432221 52350432222 52350432223 52350432224
#> [25] 52350432231 52350432232 52350432233 52350432234 52350432241 52350432242
#> [31] 52350432243 52350432244 52350432311 52350432312 52350432313 52350432314
#> [37] 52350432321 52350432322 52350432323 52350432324 52350432331 52350432332
#> [43] 52350432333 52350432334 52350432341 52350432342 52350432343 52350432344
#> [49] 52350432411 52350432412 52350432413 52350432414 52350432421 52350432422
#> [55] 52350432423 52350432424 52350432431 52350432432 52350432433 52350432434
#> [61] 52350432441 52350432442 52350432443 52350432444
mesh_convert("523504323", 0.250)
#> <meshcode[4]>
#> [1] 5235043231 5235043232 5235043233 5235043234
mesh_convert("5235043213", 0.125)
#> <meshcode[4]>
#> [1] 52350432131 52350432132 52350432133 52350432134
mesh_convert(64414315, 0.1)
#> <subdiv_meshcode[100]>
#> [1] 6441431500 6441431501 6441431502 6441431503 6441431504 6441431505
#> [7] 6441431506 6441431507 6441431508 6441431509 6441431510 6441431511
#> [13] 6441431512 6441431513 6441431514 6441431515 6441431516 6441431517
#> [19] 6441431518 6441431519 6441431520 6441431521 6441431522 6441431523
#> [25] 6441431524 6441431525 6441431526 6441431527 6441431528 6441431529
#> [31] 6441431530 6441431531 6441431532 6441431533 6441431534 6441431535
#> [37] 6441431536 6441431537 6441431538 6441431539 6441431540 6441431541
#> [43] 6441431542 6441431543 6441431544 6441431545 6441431546 6441431547
#> [49] 6441431548 6441431549 6441431550 6441431551 6441431552 6441431553
#> [55] 6441431554 6441431555 6441431556 6441431557 6441431558 6441431559
#> [61] 6441431560 6441431561 6441431562 6441431563 6441431564 6441431565
#> [67] 6441431566 6441431567 6441431568 6441431569 6441431570 6441431571
#> [73] 6441431572 6441431573 6441431574 6441431575 6441431576 6441431577
#> [79] 6441431578 6441431579 6441431580 6441431581 6441431582 6441431583
#> [85] 6441431584 6441431585 6441431586 6441431587 6441431588 6441431589
#> [91] 6441431590 6441431591 6441431592 6441431593 6441431594 6441431595
#> [97] 6441431596 6441431597 6441431598 6441431599
# Not changes
mesh_convert("52350432", 1)
#> <meshcode[1]>
#> [1] 52350432
mesh_convert("52350432131", 0.125)
#> <meshcode[1]>
#> [1] 52350432131