Creates a set of related tables to store the appropriate entities in spatial map data.

map_table(x, ...)

Arguments

x

object to tidy

...

arguments passed to methods

Value

list of tibbles

Details

The basic entities behind spatial data, and hence the "map tables" are:

vertices

the positions in geometric space, e.g. x, y, z, time, long, lat, salinity etc.

branches

a single connected chain of vertices, or "parts"

objects

a collection of branches aligned to a row of metadata

This is the basic "topology" of traditional GIS vector data, for points, lines, polygons and their multi-counterparts. By default map_tables will produce these tables and also de-duplicated the input vertices, adding a fourth table to link vertices to branches.

Other topology types such as triangle or quad meshes can extend this four-entity model, or exist without the branches at all. See "mesh_table" ??

These are currently classed as object_table, branch_table, branch_link_vertex_table, and vertex_table. But there are no methods.

Examples

data(holey) spholey <- sp(holey) map_table(spholey)
#> $o #> # A tibble: 3 x 2 #> rownumber_ object_ #> <int> <chr> #> 1 1 fZLjaCErTV #> 2 2 2kctymzdy8 #> 3 3 rQTm8TdGRQ #> #> $b #> # A tibble: 9 x 3 #> object_ branch_ island_ #> <chr> <chr> <lgl> #> 1 fZLjaCErTV bnsNDAR6ln TRUE #> 2 fZLjaCErTV QENOfVV98y FALSE #> 3 fZLjaCErTV CtkGEWmSev FALSE #> 4 fZLjaCErTV ZqJuKl6HHr FALSE #> 5 fZLjaCErTV BxbCybxI1x TRUE #> 6 fZLjaCErTV GLqrD5ynPd TRUE #> 7 2kctymzdy8 9jG0SoHZbD TRUE #> 8 rQTm8TdGRQ XYznzPFOFZ TRUE #> 9 rQTm8TdGRQ R2a39FwWKN FALSE #> #> $bXv #> # A tibble: 50 x 3 #> branch_ order_ vertex_ #> <chr> <int> <chr> #> 1 bnsNDAR6ln 1 1Jp41pyVhm #> 2 bnsNDAR6ln 2 kP15IJQpc4 #> 3 bnsNDAR6ln 3 jHh7ck68S2 #> 4 bnsNDAR6ln 4 0TtggXxd9L #> 5 bnsNDAR6ln 5 1Jp41pyVhm #> 6 QENOfVV98y 1 11vam6r27a #> 7 QENOfVV98y 2 RnTnCuJpC4 #> 8 QENOfVV98y 3 e9Lk4cKo4Y #> 9 QENOfVV98y 4 8cBN9t1H2F #> 10 QENOfVV98y 5 11vam6r27a #> # … with 40 more rows #> #> $v #> # A tibble: 27 x 3 #> x_ y_ vertex_ #> <dbl> <dbl> <chr> #> 1 0 0 1Jp41pyVhm #> 2 0 19 kP15IJQpc4 #> 3 46 19 jHh7ck68S2 #> 4 46 0 0TtggXxd9L #> 5 7 6 11vam6r27a #> 6 13 6 RnTnCuJpC4 #> 7 13 13 e9Lk4cKo4Y #> 8 7 13 8cBN9t1H2F #> 9 18 1 8Y3KV9SnsS #> 10 24 1 FzTNy7sdJn #> # … with 17 more rows #> #> attr(,"class") #> [1] "map_table" "list"