Skip to content

Commit

Permalink
Merge pull request #180 from riparias/179-new-mapping-service
Browse files Browse the repository at this point in the history
179 new mapping service
  • Loading branch information
PietrH authored May 23, 2024
2 parents 3b7b176 + 347e469 commit 7254e26
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
4 changes: 2 additions & 2 deletions R/get_objects.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ get_objects <- function(object_ids, token = get_token()) {
# Build request for the API
objects_request <-
httr2::request("https://gis.oost-vlaanderen.be/server/rest/services/") %>%
httr2::req_url_path_append("RATO",
"RATO_Private_Data",
httr2::req_url_path_append("RATO2",
"RATO2_Dossiers_Publiek",
"MapServer",
"0",
glue::glue("query?where={object_id_query}")) %>%
Expand Down
4 changes: 2 additions & 2 deletions R/list_object_ids.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ list_object_ids <- function(token = get_token()) {

object_ids_response <-
httr2::request("https://gis.oost-vlaanderen.be/server/rest/services/") %>%
httr2::req_url_path_append("RATO",
"RATO_Private_Data",
httr2::req_url_path_append("RATO2",
"RATO2_Dossiers_Publiek",
"MapServer",
"0",
"query?where=1%3D1") %>%
Expand Down
19 changes: 14 additions & 5 deletions src/dwc_mapping.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
title: "Darwin Core mapping"
subtitle: "For: The (...) occurrences of "
author:
- author_1
- author_2
- Pieter Huybrechts
- Damiano Oldoni
- Lien Reyserhove
date: "`r Sys.Date()`"
output:
html_document:
Expand Down Expand Up @@ -76,15 +77,23 @@ input_data <-
clean_names()
```

`object_id` is the unique identifier for each occurrence. This will be the `occurrenceID`. This field should contain unique values only. `dossier_id` is the unique identifier for each sampling event. This will be the `eventID`
`global_id` is used as an unique identifier for each occurrence. Up to may 2024 we used `object_id` instead, however, it turned out this identifier wasn't stable and was recalulated when the database was updated or restored from backup. We have been assured `global_id` (a GUID) will remain stable in the future.

Check whether `object_id` is unique (value should be `0`)
This field should contain unique values only. and be mapped to the `occurrenceID`. `dossier_id` is the unique identifier for each sampling event. This will be the `eventID`

Check whether `object_id` is unique (value should be `0`), this should remain the case even if we aren't using it anymore.

```{r check for duplicate object ids}
assertthat::assert_that(anyDuplicated(input_data$objectid) == 0,
msg = "OBJECTID should never be duplicated")
```
Check whether `global_id` is unique.

```{r check for duplicate global ids}
assertthat::assert_that(anyDuplicated(input_data$global_id) == 0,
msg = "Global ID should always be unique")
```

Remove all rows for `Domein` = `Werken`

Expand All @@ -98,7 +107,7 @@ input_data %<>% filter(domein != "Werken")
input_data <-
input_data %>%
mutate(event_id = dossier_id) %>%
mutate(occurrence_id = objectid)
mutate(occurrence_id = global_id)
```

Expand Down

0 comments on commit 7254e26

Please sign in to comment.