Skip to content

Commit 5304508

Browse files
committed
add geojson
1 parent 573e532 commit 5304508

File tree

2 files changed

+51
-6
lines changed

2 files changed

+51
-6
lines changed

data/b3data_package/datapackage.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"title": "Occurrence cube for birds in Belgium (MGRS 10 km)",
1313
"description": "Occurrence cube for birds in Belgium between 2000 en 2024. The taxonomical resolution is 'species' and the temporal resolution is 'year' Spatial aggregation is done using the MGRS grid at 10 km scale. Only grid cells that fall within the 10 km MGRS reference grid for mainland Belgium (see b3data: `mgrs10_refgrid_belgium.geojson`) are included.",
1414
"sources": ["GBIF Occurrence Download", "https://doi.org/10.15468/dl.y3wpwk"],
15-
"licenses": [" CC BY-NC 4.0", "https://creativecommons.org/licenses/by-nc/4.0/", "Creative Commons Attribution-NonCommercial 4.0 International"],
15+
"licenses": ["CC BY-NC 4.0", "https://creativecommons.org/licenses/by-nc/4.0/", "Creative Commons Attribution-NonCommercial 4.0 International"],
1616
"schema": {
1717
"fields": [
1818
{
@@ -49,12 +49,21 @@
4949
}
5050
]
5151
}
52+
},
53+
{
54+
"name": "mgrs10_refgrid_belgium",
55+
"path": "mgrs10_refgrid_belgium.geojson",
56+
"profile": "spatial-data-resource",
57+
"format": "geojson",
58+
"title": "MGRS 10 Km reference grid Belgium",
59+
"description": "MGRS 10 Km reference grid for the mainland of Belgium.",
60+
"licenses": ["CC0 1.0", "https://creativecommons.org/publicdomain/zero/1.0/", "Creative Commons Zero v1.0 Universal"]
5261
}
5362
],
5463
"title": "b3data: Data resources for the b3verse",
5564
"description": "This data package contains data resources to be used across the b3verse (https://docs.b-cubed.eu/guides/b3verse/). This includes example datasets (occurrence cubes) as well as spatial resources like reference grids or raster data.",
5665
"keywords1": "data cubes",
57-
"licenses.name": " CC BY-NC 4.0",
66+
"licenses.name": "CC BY-NC 4.0",
5867
"version": "0.1.0",
5968
"sources.title": "b3data-scripts",
6069
"contributors.title": "Ward Langeraert",

source/add_spatial_resources.Rmd

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ library(sf) # Spatial objects
2626
data_path <- here::here("data", "raw")
2727
dir.create(data_path, showWarnings = FALSE, recursive = TRUE)
2828
29-
out_path <- here::here("data", "processed")
30-
dir.create(out_path, showWarnings = FALSE, recursive = TRUE)
29+
package_path <- here::here("data", "b3data_package")
30+
dir.create(package_path, showWarnings = FALSE, recursive = TRUE)
3131
```
3232

3333
# Goal
@@ -84,9 +84,45 @@ mgrs10_refgrid_belgium <- utm10_bel %>%
8484
select(mgrscode, geometry)
8585
```
8686

87+
Write to data package and add metadata.
88+
89+
```{r}
90+
st_write(mgrs10_refgrid_belgium,
91+
file.path(package_path, "mgrs10_refgrid_belgium.geojson"),
92+
append = FALSE)
93+
```
94+
95+
```{r}
96+
if (FALSE) {
97+
# Read package
98+
b3data_package <- read_package(file.path(package_path, "datapackage.json"))
99+
100+
# Add spatial resources manually
101+
b3data_package$resources <- append(b3data_package$resources, list(
102+
list(
103+
name = "mgrs10_refgrid_belgium",
104+
path = "mgrs10_refgrid_belgium.geojson",
105+
profile = "spatial-data-resource",
106+
format = "geojson",
107+
title = "MGRS 10 Km reference grid Belgium",
108+
description = "MGRS 10 Km reference grid for the mainland of Belgium.",
109+
licenses = c(
110+
name = "CC0 1.0",
111+
path = "https://creativecommons.org/publicdomain/zero/1.0/",
112+
title = "Creative Commons Zero v1.0 Universal"
113+
)
114+
)
115+
))
116+
117+
# Write package to directory
118+
# Write package to directory
119+
write_package(
120+
package = b3data_package,
121+
directory = package_path,
122+
compress = TRUE)
123+
}
124+
```
87125

88126
## EEA 100 km reference grid Europe
89127

90128
> Coming soon
91-
92-
# Write package

0 commit comments

Comments
 (0)