diff --git a/18-import-and-visualise-osm-data.md b/18-import-and-visualise-osm-data.md index c518a54d..a1c5e23d 100644 --- a/18-import-and-visualise-osm-data.md +++ b/18-import-and-visualise-osm-data.md @@ -371,8 +371,8 @@ leaflet(buildings2) %>% bringToFront = TRUE)) ``` -
- +
+ ::::::::::::::::::::::::::::::::: diff --git a/2-vector-slides.html b/2-vector-slides.html index 7d6dd9fd..27eda552 100644 --- a/2-vector-slides.html +++ b/2-vector-slides.html @@ -8,7 +8,7 @@ - + @@ -27,12 +27,12 @@ ul.task-list{list-style: none;} ul.task-list li input[type="checkbox"] { width: 0.8em; - margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */ + margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */ vertical-align: middle; } /* CSS for syntax highlighting */ pre > code.sourceCode { white-space: pre; position: relative; } - pre > code.sourceCode > span { line-height: 1.25; } + pre > code.sourceCode > span { display: inline-block; line-height: 1.25; } pre > code.sourceCode > span:empty { height: 1.2em; } .sourceCode { overflow: visible; } code.sourceCode > span { color: inherit; text-decoration: inherit; } @@ -107,11 +107,11 @@ .callout { margin-top: 1em; - margin-bottom: 1em; + margin-bottom: 1em; border-radius: .25rem; } - .callout.callout-style-simple { + .callout.callout-style-simple { padding: 0em 0.5em; border-left: solid #acacac .3rem; border-right: solid 1px silver; @@ -162,7 +162,7 @@ margin-top: 0.5em; margin-bottom: 0.5em; } - + .callout.callout-titled.callout-style-simple .callout-content p { margin-top: 0; } @@ -213,7 +213,7 @@ .callout-title { display: flex } - + .callout-icon::before { margin-top: 1rem; padding-right: .5rem; @@ -224,8 +224,7 @@ } .callout.callout-titled .callout-body > .callout-content > :last-child { - padding-bottom: 0.5rem; - margin-bottom: 0; + margin-bottom: 0.5rem; } .callout.callout-titled .callout-icon::before { @@ -326,12 +325,12 @@ } .reveal .footnotes ol { counter-reset: ol; - list-style-type: none; + list-style-type: none; margin-left: 0; } .reveal .footnotes ol li:before { counter-increment: ol; - content: counter(ol) ". "; + content: counter(ol) ". "; } .reveal .footnotes ol li > p:first-child { display: inline-block; @@ -373,19 +372,19 @@ .reveal .slide > img.r-stretch.quarto-figure-center { display: block; margin-left: auto; - margin-right: auto; + margin-right: auto; } .reveal .slide > img.stretch.quarto-figure-left, .reveal .slide > img.r-stretch.quarto-figure-left { display: block; margin-left: 0; - margin-right: auto; + margin-right: auto; } .reveal .slide > img.stretch.quarto-figure-right, .reveal .slide > img.r-stretch.quarto-figure-right { display: block; margin-left: auto; - margin-right: 0; + margin-right: 0; } @@ -401,12 +400,12 @@

Introduction to Geospatial Vector Data with R

-Ana Petrović +Ana Petrović
-Claudiu Forgaci +Claudiu Forgaci
@@ -612,7 +611,15 @@

Map scale

- + +
+

Types of geospatial data

+ +
+
+

Raster and vector representations

+ +

Source: Saab, 2003

Geospatial Vector Data in R

@@ -621,7 +628,7 @@

Geospatial Vector Data in R

The sf package

-

Illustration (c) 2018 by Allison Horst

+

Illustration (c) 2018 by Allison Horst

The sf package

-
+ +
+

Geometry in QGIS

+ +
+
+

Geometry in R

+ +

Open and Plot Shapefiles

@@ -647,7 +662,7 @@

Challenge 1: 5 mins

-
+
03:00
@@ -655,17 +670,17 @@

Challenge 1: 5 mins

-
lines_Delft <- st_read(here("episodes", "data", "delft-streets.shp"))
-point_Delft <- st_read(here("episodes", "data", "delft-leisure.shp"))
-
-st_geometry_type(lines_Delft)
-st_geometry_type(point_Delft)
-
-st_crs(lines_Delft)
-st_crs(point_Delft)
-
-st_bbox(lines_Delft)
-st_bbox(point_Delft)
+
lines_Delft <- st_read(here("episodes", "data", "delft-streets.shp"))
+point_Delft <- st_read(here("episodes", "data", "delft-leisure.shp"))
+
+st_geometry_type(lines_Delft)
+st_geometry_type(point_Delft)
+
+st_crs(lines_Delft)
+st_crs(point_Delft)
+
+st_bbox(lines_Delft)
+st_bbox(point_Delft)
@@ -686,7 +701,7 @@

Challenge 2: 3 mins

⁣        A) location B) leisure C) osm_id

-
+
03:00
@@ -696,15 +711,15 @@

Challenge 2: 3 mins

-
ncol(point_Delft)
-ncol(boundary_Delft)
-
-head(point_Delft)
-head(point_Delft, 10)
-
-point_Delft
-
-names(point_Delft)
+
ncol(point_Delft)
+ncol(boundary_Delft)
+
+head(point_Delft)
+head(point_Delft, 10)
+
+point_Delft
+
+names(point_Delft)
@@ -719,7 +734,7 @@

Challenge 3: 5 mins

-
+
05:00
@@ -727,22 +742,22 @@

Challenge 3: 5 mins

-
levels(factor(lines_Delft$highway))
-
-motorway_Delft <- lines_Delft %>% 
-  filter(highway == "motorway")
-
-motorway_Delft %>% 
-  mutate(length = st_length(.)) %>% 
-  select(everything(), geometry) %>%
-  summarise(total_length = sum(length))
-
-nrow(motorway_Delft)
-
-ggplot(data = motorway_Delft) +
-  geom_sf(size = 1.5) +
-  ggtitle("Mobility network of Delft", subtitle = "Motorways") +
-  coord_sf()
+
levels(factor(lines_Delft$highway))
+
+motorway_Delft <- lines_Delft %>% 
+  filter(highway == "motorway")
+
+motorway_Delft %>% 
+  mutate(length = st_length(.)) %>% 
+  select(everything(), geometry) %>%
+  summarise(total_length = sum(length))
+
+nrow(motorway_Delft)
+
+ggplot(data = motorway_Delft) +
+  geom_sf(size = 1.5) +
+  ggtitle("Mobility network of Delft", subtitle = "Motorways") +
+  coord_sf()
@@ -758,7 +773,7 @@

Challenge 4: 3 mins

-
+
03:00
@@ -766,16 +781,16 @@

Challenge 4: 3 mins

-
levels(factor(lines_Delft$highway))
-
-line_widths <- c(0.25, 0.75, 0.5, 1)
-
-ggplot(data = lines_Delft_selection) +
-  geom_sf(aes(size = highway)) +
-  scale_size_manual(values = line_widths) +
-  labs(size = "Road Size") +
-  ggtitle("Mobility network of Delft", subtitle = "Roads & Cycleways - Line width varies") +
-  coord_sf()
+
levels(factor(lines_Delft$highway))
+
+line_widths <- c(0.25, 0.75, 0.5, 1)
+
+ggplot(data = lines_Delft_selection) +
+  geom_sf(aes(size = highway)) +
+  scale_size_manual(values = line_widths) +
+  labs(size = "Road Size") +
+  ggtitle("Mobility network of Delft", subtitle = "Roads & Cycleways - Line width varies") +
+  coord_sf()
@@ -789,7 +804,7 @@

Challenge 5: 5 mins

-
+
05:00
@@ -797,16 +812,16 @@

Challenge 5: 5 mins

-
levels(factor(lines_Delft_selection$highway))
-
-lines_Delft_bicycle <- lines_Delft %>% 
-  filter(highway == "cycleway")
-
-ggplot() +
-  geom_sf(data = lines_Delft) +
-  geom_sf(data = lines_Delft_bicycle, color = "magenta", size = 2) +
-  ggtitle("Mobility network of Delft", subtitle = "Roads dedicated to bikes") +
-  coord_sf()
+
levels(factor(lines_Delft_selection$highway))
+
+lines_Delft_bicycle <- lines_Delft %>% 
+  filter(highway == "cycleway")
+
+ggplot() +
+  geom_sf(data = lines_Delft) +
+  geom_sf(data = lines_Delft_bicycle, color = "magenta", size = 2) +
+  ggtitle("Mobility network of Delft", subtitle = "Roads dedicated to bikes") +
+  coord_sf()
@@ -820,7 +835,7 @@

Challenge 6: 3 mins

-
+
03:00
@@ -828,14 +843,14 @@

Challenge 6: 3 mins

-
municipal_boundaries_NL <- st_read(here("episodes", "data", "nl-gemeenten.shp"))
-str(municipal_boundaries_NL)
-levels(factor(municipal_boundaries_NL$ligtInPr_1))
-
-ggplot(data = municipal_boundaries_NL) +
-  geom_sf(aes(color = ligtInPr_1), size = 1) +
-  ggtitle("Contiguous NL Municipal Boundaries") +
-  coord_sf()
+
municipal_boundaries_NL <- st_read(here("episodes", "data", "nl-gemeenten.shp"))
+str(municipal_boundaries_NL)
+levels(factor(municipal_boundaries_NL$ligtInPr_1))
+
+ggplot(data = municipal_boundaries_NL) +
+  geom_sf(aes(color = ligtInPr_1), size = 1) +
+  ggtitle("Contiguous NL Municipal Boundaries") +
+  coord_sf()
@@ -855,7 +870,7 @@

Challenge 7: 5 mins

-
+
05:00
@@ -863,24 +878,24 @@

Challenge 7: 5 mins

-
leisure_locations_selection <- st_read(here("episodes", "data", "delft-leisure.shp")) %>% 
-  filter(leisure %in% c("playground", "picnic_table"))
-
-blue_orange <- c("cornflowerblue", "darkorange")
-
-p <- ggplot() + 
-  geom_sf(data = lines_Delft_selection, aes(color = highway)) + 
-  scale_color_manual(name = "Line Type", values = road_colors) +
-  ggtitle("Road network and leisure")
-
-p +
-  geom_sf(data = leisure_locations_selection, aes(fill = leisure), shape = 21) +
-  scale_fill_manual(name = "Leisure Type", values = blue_orange)
-
-p + 
-  geom_sf(data = leisure_locations_selection, aes(fill = leisure, shape = leisure), size = 3) +
-  scale_fill_manual(name = "Leisure Type", values = blue_orange) +
-  scale_shape_manual(name = "Leisure Type", values = c(21, 22))
+
leisure_locations_selection <- st_read(here("episodes", "data", "delft-leisure.shp")) %>% 
+  filter(leisure %in% c("playground", "picnic_table"))
+
+blue_orange <- c("cornflowerblue", "darkorange")
+
+p <- ggplot() + 
+  geom_sf(data = lines_Delft_selection, aes(color = highway)) + 
+  scale_color_manual(name = "Line Type", values = road_colors) +
+  ggtitle("Road network and leisure")
+
+p +
+  geom_sf(data = leisure_locations_selection, aes(fill = leisure), shape = 21) +
+  scale_fill_manual(name = "Leisure Type", values = blue_orange)
+
+p + 
+  geom_sf(data = leisure_locations_selection, aes(fill = leisure, shape = leisure), size = 3) +
+  scale_fill_manual(name = "Leisure Type", values = blue_orange) +
+  scale_shape_manual(name = "Leisure Type", values = c(21, 22))
@@ -901,7 +916,7 @@

Challenge 8: 3 mins

-
+
03:00
@@ -909,22 +924,20 @@

Challenge 8: 3 mins

-
boundary_ZH <- municipal_boundary_NL %>% 
-  filter(ligtInPr_1 == "Zuid-Holland")
-
-ggplot() +
-  geom_sf(data = boundary_ZH, aes(color ="color"), show.legend = "line") +
-  scale_color_manual(name = "", labels = "Municipal Boundaries", values = c("color" = "gray18")) +
-  geom_sf(data = boundary_Delft, aes(shape = "shape"), color = "purple", fill = "purple") +
-  scale_shape_manual(name = "", labels = "Municipality of Delft", values = c("shape" = 19)) +
-  ggtitle("Delft location in South Holland") +
-  theme(legend.background = element_rect(color = NA)) +
-  coord_sf()
-
-
+
boundary_ZH <- municipal_boundary_NL %>% 
+  filter(ligtInPr_1 == "Zuid-Holland")
+
+ggplot() +
+  geom_sf(data = boundary_ZH, aes(color ="color"), show.legend = "line") +
+  scale_color_manual(name = "", labels = "Municipal Boundaries", values = c("color" = "gray18")) +
+  geom_sf(data = boundary_Delft, aes(shape = "shape"), color = "purple", fill = "purple") +
+  scale_shape_manual(name = "", labels = "Municipality of Delft", values = c("shape" = 19)) +
+  ggtitle("Delft location in South Holland") +
+  theme(legend.background = element_rect(color = NA)) +
+  coord_sf()
+
@@ -940,7 +953,7 @@

Challenge 8: 3 mins

- + @@ -955,6 +968,7 @@

Challenge 8: 3 mins

Reveal.initialize({ 'controlsAuto': true, 'previewLinksAuto': false, +'smaller': false, 'pdfSeparateFragments': false, 'autoAnimateEasing': "ease", 'autoAnimateDuration': 1, @@ -962,7 +976,7 @@

Challenge 8: 3 mins

'menu': {"side":"left","useTextContentForMissingTitles":true,"markers":false,"loadIcons":false,"custom":[{"title":"Tools","icon":"","content":""}],"openButton":true}, 'chalkboard': {"buttons":true}, 'smaller': false, - + // Display controls in the bottom right corner controls: false, @@ -1140,7 +1154,7 @@

Challenge 8: 3 mins

] }); - + - - \ No newline at end of file + + diff --git a/fig/geometry-qgis.png b/fig/geometry-qgis.png new file mode 100644 index 00000000..18d8fe4f Binary files /dev/null and b/fig/geometry-qgis.png differ diff --git a/fig/geometry-r.png b/fig/geometry-r.png new file mode 100644 index 00000000..bdc0a1fd Binary files /dev/null and b/fig/geometry-r.png differ diff --git a/fig/raster-vector-data-types.png b/fig/raster-vector-data-types.png new file mode 100644 index 00000000..d5123d0a Binary files /dev/null and b/fig/raster-vector-data-types.png differ diff --git a/fig/raster-vector.jpg b/fig/raster-vector.jpg new file mode 100644 index 00000000..eba3e99c Binary files /dev/null and b/fig/raster-vector.jpg differ diff --git a/local-data-guidelines.html b/local-data-guidelines.html new file mode 100644 index 00000000..58a18703 --- /dev/null +++ b/local-data-guidelines.html @@ -0,0 +1,307 @@ + + + + + + + + + +Guidelines for local workshop data + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+

Guidelines for local workshop data

+
+ + + +
+ + + + +
+ + +
+ +
+

Heading 1

+

text

+
+ +
+ + +
+ + + + \ No newline at end of file