-
Notifications
You must be signed in to change notification settings - Fork 0
/
map-updates.qmd
135 lines (109 loc) · 3.85 KB
/
map-updates.qmd
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
---
title: "Map updates"
subtitle: "Priorities for map updates"
format: html
execute:
echo: false
---
As part of our data curation process we consider updates and improvements to all the maps. This is currently done in an irregular basis depending on time and resource availability.
We have set up some priorities for map development and updates, but we also consider issues raised by users. Please add your comments and suggestions using the dialogue boxes below each page, or go directly to our GitHub repository.
```{r}
#| message: false
#| warning: false
#library(ggplot2)
library(dplyr)
#library(DT)
#library(igraph)
#library(stringr)
#library(tidyr)
#library(lubridate)
library(RPostgreSQL)
# load("Map-evaluation-data.rda")
here::i_am("map-updates.qmd")
```
```{r}
#| message: false
#| warning: false
#| results: false
drv <- dbDriver("PostgreSQL") ## remember to update .pgpass file
con <- dbConnect(drv,
dbname = Sys.getenv("DBNAME"),
host = Sys.getenv("DBHOST"),
port = Sys.getenv("DBPORT"),
user = Sys.getenv("DBUSER"))
qry <- "
select license, count(*) as n
from map_evaluation
left join map_metadata USING(map_code,map_version)
where status = 'valid' and map_type = 'Indicative Map'
GROUP BY license;
"
maps_licenses <- dbGetQuery(con,qry)
qry <- "
SELECT license, evaluation[1] as evaluation, count(*) as N
FROM map_evaluation
LEFT JOIN map_metadata USING (map_code, map_version)
WHERE status = 'valid' AND map_type = 'Indicative Map'
GROUP BY license, evaluation
ORDER BY license, evaluation;
"
license_evaluation <- dbGetQuery(con,qry)
dbDisconnect(con)
```
## Checking dataset licenses
First we check the dataset licenses and aim to replace datasets that have any restrictions of use.
```{r}
license_evaluation_summary <-
license_evaluation |>
transmute(`datasets used` = case_when(
license %in% 'Non-commercial use' ~ "restricted use",
license %in% c(NA, 'Undocumented', 'See contact info') ~ "unclear/undocumented",
TRUE ~ "commercial use allowed"
),
`Evaluation` = case_when(
evaluation %in% c("Medium quality map", "Medium quality map series") ~ "Good enough",
evaluation %in% "Coarse quality map" ~ "Unsatisfactory",
evaluation %in% c("Fine quality map", "Fine quality map series") ~ "Best",
TRUE ~ evaluation
),
n
)
```
```{r}
license_evaluation_summary |>
group_by(`datasets used`) |>
summarise(total = sum(n), .groups = "drop") |>
knitr::kable()
```
## Improving quality
The second step is to review map quality as we aim to create higher quality maps with better overall evaluation:
```{r}
license_evaluation_summary |>
filter(`datasets used` %in% "commercial use allowed") |>
group_by(`Evaluation`) |>
summarise(total = sum(n), .groups = "drop") |>
knitr::kable()
```
## Next steps
```{mermaid}
%%| theme: forest
%%| label: priorities
%%| fig-cap: |
%%| Summary of license and evaluation of EFG maps to identify
%%| priorities for map updates.
flowchart TB
check1(["Check datasets used:\n license?"]):::checks
check2(["Check:\n - spatial resolution\n- validation\n- concept match\n(uncertainty)"]):::checks
step1(["Search\navailable/new\n datasets"]):::checks
ready(["Hurray!"]):::done
almostready([Best possible version\nflag any issues]):::done
classDef checks fill:#d0e9fa,stroke:#000
classDef steps fill:#d0d93a,stroke:#000
classDef done fill:#c6fc9c,stroke:#000
check1 -->|n=37 allows\ncommercial use| check2
check1 -->|n=62 restricted use| step1
check1 -.->|n=7 unclear/undocumented| step1
check2 -->|n=14 golden standard| ready
check2 -->|n=5 not perfect\nbut close enough| almostready
check2 -->|n=18 unsatisfactory| step1
```