Convert and export meshcode area to sfc_POLYGON and sf.

export_mesh(meshcode)

export_meshes(meshcode, .keep_class = FALSE)

Arguments

meshcode

character. mesh code

.keep_class

Do you want to assign a class to the meshcode column in data.frame? If FALSE, it will be treated as a character type.

Value

sfc object

sf object

Examples

export_mesh("6441427712")
#> Geometry set for 1 feature 
#> Geometry type: POLYGON
#> Dimension:     XY
#> Bounding box:  xmin: 141.3406 ymin: 43.05833 xmax: 141.3438 ymax: 43.06042
#> Geodetic CRS:  WGS 84
#> POLYGON ((141.3406 43.05833, 141.3438 43.05833,...
export_meshes("4128")
#> Simple feature collection with 1 feature and 1 field
#> Geometry type: POLYGON
#> Dimension:     XY
#> Bounding box:  xmin: 128 ymin: 27.33333 xmax: 129 ymax: 28
#> Geodetic CRS:  WGS 84
#> # A tibble: 1 × 2
#>   meshcode                                                     geometry
#>   <chr>                                                   <POLYGON [°]>
#> 1 4128     ((128 27.33333, 129 27.33333, 129 28, 128 28, 128 27.33333))
find_neighbor_mesh("37250395") %>%
  export_meshes()
#> Simple feature collection with 9 features and 1 field
#> Geometry type: POLYGON
#> Dimension:     XY
#> Bounding box:  xmin: 125.425 ymin: 24.73333 xmax: 125.4625 ymax: 24.75833
#> Geodetic CRS:  WGS 84
#> # A tibble: 9 × 2
#>   meshcode                                                              geometry
#>   <chr>                                                            <POLYGON [°]>
#> 1 37250384 ((125.425 24.73333, 125.4375 24.73333, 125.4375 24.74167, 125.425 24…
#> 2 37250385 ((125.4375 24.73333, 125.45 24.73333, 125.45 24.74167, 125.4375 24.7…
#> 3 37250386 ((125.45 24.73333, 125.4625 24.73333, 125.4625 24.74167, 125.45 24.7…
#> 4 37250394 ((125.425 24.74167, 125.4375 24.74167, 125.4375 24.75, 125.425 24.75…
#> 5 37250395 ((125.4375 24.74167, 125.45 24.74167, 125.45 24.75, 125.4375 24.75, …
#> 6 37250396 ((125.45 24.74167, 125.4625 24.74167, 125.4625 24.75, 125.45 24.75, …
#> 7 37251304 ((125.425 24.75, 125.4375 24.75, 125.4375 24.75833, 125.425 24.75833…
#> 8 37251305 ((125.4375 24.75, 125.45 24.75, 125.45 24.75833, 125.4375 24.75833, …
#> 9 37251306 ((125.45 24.75, 125.4625 24.75, 125.4625 24.75833, 125.45 24.75833, …