Skip to content

Commit

Permalink
Merge pull request #77 from ClementineCttn/main
Browse files Browse the repository at this point in the history
fix bug in website and update slides with replicability example
  • Loading branch information
ClementineCttn authored Feb 7, 2025
2 parents 839cc1b + 445dadf commit cd63341
Show file tree
Hide file tree
Showing 19 changed files with 16,065 additions and 173 deletions.
5 changes: 2 additions & 3 deletions episodes/18-import-and-visualise-osm-data.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,9 @@ Anything odd? What? Around the centre? Why these limits / isolated points?
We have produced a proof a concept on Brielle, but can we factorise our work to be replicable with other small fortified cities? You can use any of the following cities: *Naarden*, *Geertruidenberg*, *Gorinchem*, *Enkhuizen* or *Dokkum*.

We might replace the name in the first line and run everything again. Or we can create a function.
```{r reproducibility}
```{r Replicability}
extract_buildings <- function(cityname, year=1900){
nominatim_polygon <- geo_lite_sf(address = cityname, points_only = FALSE)
bb <- st_bbox(nominatim_polygon)
bb <- getbb(cityname)
x <- opq(bbox = bb) %>%
add_osm_feature(key = 'building') %>%
Expand Down
414 changes: 244 additions & 170 deletions instructors/4-gis-slides.html

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions instructors/4-gis-slides.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,51 @@ Why these limits / isolated points?
:::
:::

## Replicability


We have produced a proof a concept on Brielle, but can we factorise our work to be replicable with other small fortified cities? You can use any of the following cities: *Naarden*, *Geertruidenberg*, *Gorinchem*, *Enkhuizen* or *Dokkum*.

We might replace the name in the first line and run everything again... or we can create a function.

## Replicability

```{r reproducibility}
extract_buildings <- function(cityname, year=1900){
bb <- getbb(cityname)
x <- opq(bbox = bb) %>%
add_osm_feature(key = 'building') %>%
osmdata_sf()
buildings <- x$osm_polygons %>%
st_transform(.,crs=28992)
start_date <- as.numeric(buildings$start_date)
buildings$build_date <- if_else(start_date < year, year, start_date)
ggplot(data = buildings) +
geom_sf(aes(fill = build_date, colour=build_date)) +
scale_fill_viridis_c(option = "viridis")+
scale_colour_viridis_c(option = "viridis") +
ggtitle(paste0("Old buildings in ",cityname)) +
coord_sf(datum = st_crs(28992))
}
```

## Test on Brielle

```{r brielle}
extract_buildings("Brielle, NL")
```


## Test on Naarden
```{r naarden}
extract_buildings("Naarden, NL")
```


## Challenge

Import an interactive basemap layer under the buildings with [Leaflet](https://rstudio.github.io/leaflet/), using the package documentation.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@layer htmltools {
.html-fill-container {
display: flex;
flex-direction: column;
/* Prevent the container from expanding vertically or horizontally beyond its
parent's constraints. */
min-height: 0;
min-width: 0;
}
.html-fill-container > .html-fill-item {
/* Fill items can grow and shrink freely within
available vertical space in fillable container */
flex: 1 1 auto;
min-height: 0;
min-width: 0;
}
.html-fill-container > :not(.html-fill-item) {
/* Prevent shrinking or growing of non-fill items */
flex: 0 0 auto;
}
}
Loading

0 comments on commit cd63341

Please sign in to comment.