Skip to content

Commit

Permalink
fixes #1065
Browse files Browse the repository at this point in the history
  • Loading branch information
Nowosad committed Feb 4, 2024
1 parent 1424ead commit f2b3b05
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions 08-read-write-plot.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,11 @@ write_sf(obj = world, dsn = "world.gpkg")
write_sf(obj = world, dsn = "world.gpkg")
```

Instead of overwriting the file, we could add a new layer to the file with `append = TRUE`, which is supported by several spatial formats, including GeoPackage.
Instead of overwriting the file, we could add a new layer to the file by specifying the `layer` argument.
This is supported by several spatial formats, including GeoPackage.

```{r 07-read-write-plot-31, results='hide'}
write_sf(obj = world, dsn = "world_many_layers.gpkg", append = TRUE)
write_sf(obj = world, dsn = "world_many_layers.gpkg", layer = "second_layer")
```

Alternatively, you can use `st_write()` since it is equivalent to `write_sf()`.
Expand Down

0 comments on commit f2b3b05

Please sign in to comment.