Extracts the archive to a temporary directory and reads each KML layer with sf::read_sf() after sf::st_layers(). Multiple KML files or multiple layers yield one row per layer; layer_name is simplified when there is only one layer in one file.

read_kmz(path, quiet = TRUE, ...)

Arguments

path

Path to a .kmz file.

quiet

Passed to sf::read_sf().

...

Additional arguments passed to sf::read_sf().

Value

A tibble with the same columns as read_gdb(). Here fpath is the path to the original .kmz (not the temporary .kml), and file_type is typically "kmz". Metadata columns still come from sf::st_layers() on the extracted KML file used for reading.

Examples

# \donttest{
kmz <- system.file("extdata", "misc_example.kmz", package = "misc")
if (nzchar(kmz) && file.exists(kmz)) read_kmz(kmz)
#> # A tibble: 1 × 8
#>   fpath   file_type layer_name geometry_type nrows_aka_features ncols_aka_fields
#>   <chr>   <chr>     <chr>      <chr>                      <int>            <int>
#> 1 /home/… kmz       doc        ""                             1               12
#> # ℹ 2 more variables: crs_name <chr>, data <list>
# }