-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (68 loc) · 4.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
---
title: "Parkplatzbelegung Stadt Frauenfeld nach Stunden"
author: "OGD-Koordinationsstelle Kanton Thurgau"
date: "`r Sys.Date()`"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## Open Government Data, provided by **Canton Thurgau**
*Autogenerated R starter code for geo-dataset with the identifier* **frauenfeld-2**
# **Parkplatzbelegung Stadt Frauenfeld nach Stunden**
[Link to dataset on data.tg.ch](https://data.tg.ch/explore/dataset/frauenfeld-2/information/)
## Description
<p>Der Datensatz beinhaltet Daten zur Parkplatzbelegung auf fünf öffentlichen Parkplätzen in Frauenfeld, die in städtischer Hand sind: Unteres Mätteli, Oberes Mätteli, Marktplatz (2 Stunden und 10 Stunden), Altstadt (Freie-Strasse, Bankplatz) sowie Zürcherstrasse (Abschnitt Innenstadt). Die Daten sind auf Stundenbasis aggregiert und beinhalten die durchschnittliche Belegung in %, die Anzahl der Aus- und Einfahrten sowie die mittlere Standzeit (Median) der Fahrzeuge. Alle Parkplätze sind zudem geokodiert. Die Daten werden jeden Tag aktualisiert und beinhalten Daten bis zum Vortag.</p><p>Die Daten sind Teil des Pilotprojekts Smart Parking Frauenfeld. Mithilfe von Kameras und künstlicher Intelligenz werden hier Daten zur Parksituation auf den jeweiligen Parkplätzen ermittelt.</p><p><br></p><p><span>Über die </span><a href='https://regiofrauenfeld.citymobile.ch/index.php?brandid=11579&apid=1155685913' style='background-color: rgb(255, 255, 255); font-family: sans-serif; font-weight: 400;' target='_blank'>Regio Frauenfeld App</a><span> kann </span><span>die aktuelle Parksituation auf den fünf Parkplätze anhand von Echtzeit-Daten geprüft werden.</span><br></p><p><a href='https://frauenfeld.citymobile.ch/index.php?apid=2096681313' style='background-color: rgb(255, 255, 255); text-decoration: none; color: rgb(40, 154, 215); font-family: sans-serif; font-size: 15px; font-weight: 400;'>Link zur Desktopansicht der App</a><br></p><p><br>Datenquelle: Stadt Frauenfeld</p>
## Metadata
- **Issued** :
- **Modified** : 2025-04-28 02:17:24
- **Rights** : CC BY 4.0
- **Keywords** : Frauenfeld , parken, parkplatz, marktplatz, app, live, einfahrt, ausfahrt, standzeit, Marktplatz, Oberes Mätteli, Altstatdt, Zürcherstrasse, Parquery, Region Frauenfeld, regio frauenfeld app, frei, belegt, belegung, smart, parking, pilotprojekt, kamera, KI, künstliche, intelligenz
## Load Packages
Every dataset (csv and geodata) on [data.tg.ch](https://data.tg.ch/pages/start/) can be retrieved with the **tgAPI** package. You can download it via [GitHub](https://github.com/ogdtg/tgAPI). Our Geodata rely on WFS Services and you can download them layer by layer. In some cases the layer data is very large. Therefore, the download may take some time.
```{r}
library(remotes)
remotes::install.github("ogdtg/tgAPI")
library(tgAPI)
#install.packages(ggplot2)
#install.packages(dplyr)
library(dplyr)
library(ggplot2)
library(sf)
```
## Get the Features (layers) of the Geodata
Some datsets are raster data. They do not contain layers and they cannot be downloaded, yet.
```{r}
features <- get_geo_features("frauenfeld-2")
features
```
## Download the first feature
Features can be downloaded by using their name or their label. The result of the download will be a dat.frame of the class `sf`. You can directly use it for geospatial analysis.
```{r}
feature_num <- 1
geo_data <- get_geo_data("frauenfeld-2",features$name[feature_num])
tg_data <- get_geo_data("amtliche-vermessung-av", "Gemeindegrenzen")
head(geo_data)
```
## Analyze Data
```{r}
# Look at the dataset and its structure
summary(geo_data)
```
## Plot Data
The base layer shows the borders of the municipalities (`Gemeindegrenzen`). The downloaded feature is colored red
```{r}
# Plot the data
geo_data %>% ggplot() +geom_sf(data = tg_data) + geom_sf(color = "red") +
labs(title = paste0("Parkplatzbelegung Stadt Frauenfeld nach Stunden: ",features$title[feature_num])) +
theme_minimal()
```
## Continue your code here...
```{r}
# Do some data magic with R
```
------------------------------------------------------------------------
## Questions about the data?
Contact us via [Mail](mailto:[email protected]) or visit our [GitHub presence](https://github.com/ogdtg)
------------------------------------------------------------------------
OGD-Koordinationsstelle Kanton Thurgau | Grabenstrasse 8 | 8510 Frauenfeld