diff --git a/README.Rmd b/README.Rmd index 6a16e4d..1690bce 100644 --- a/README.Rmd +++ b/README.Rmd @@ -36,7 +36,22 @@ This is a basic example which shows you how to solve a common problem: ```{r example} library(CRiSp) -## basic example code + +# Set location parameters +city_name <- "Bucharest" +river_name <- "Dâmbovița" +epsg_code <- 32635 + +# Get base layer for plotting +bucharest_bb <- get_osm_bb(city_name) +bucharest_streets <- get_osm_streets(bucharest_bb, epsg_code)[, "geometry"] + +# Delineate river corridor +bucharest_river <- delineate_corridor("Bucharest", "Dâmbovița", epsg_code) + +# Plot results +plot(bucharest_river, border = "orange", lwd = 3) +plot(bucharest_streets, add = TRUE) ``` ## Contributing diff --git a/README.md b/README.md index b30bd66..b2a1799 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,28 @@ This is a basic example which shows you how to solve a common problem: ``` r library(CRiSp) -## basic example code + +# Set location parameters +city_name <- "Bucharest" +river_name <- "Dâmbovița" +epsg_code <- 32635 + +# Get base layer for plotting +bucharest_bb <- get_osm_bb(city_name) +bucharest_streets <- get_osm_streets(bucharest_bb, epsg_code)[, "geometry"] + +# Delineate river corridor +bucharest_river <- delineate_corridor("Bucharest", "Dâmbovița", epsg_code) +#> Warning: to_spatial_subdivision assumes attributes are constant over geometries +#> Linking to GEOS 3.11.0, GDAL 3.5.3, PROJ 9.1.0; sf_use_s2() is TRUE + +# Plot results +plot(bucharest_river, border = "orange", lwd = 3) +plot(bucharest_streets, add = TRUE) ``` + + ## Contributing We look very much forward to contributions to the package. See the @@ -38,3 +57,4 @@ We look very much forward to contributions to the package. See the This package is released with a [Contributor Code of Conduct](.github/CODE_OF_CONDUCT.md). By contributing to this project you agree to abide by its terms. + diff --git a/man/figures/README-example-1.png b/man/figures/README-example-1.png new file mode 100644 index 0000000..1bcac86 Binary files /dev/null and b/man/figures/README-example-1.png differ