Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WoSIS GraphQL API masterclass
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ISRIC
databases
WoSIS GraphQL API masterclass
Commits
58aeb3f5
Commit
58aeb3f5
authored
1 year ago
by
lcalisto
Browse files
Options
Downloads
Patches
Plain Diff
Updated R scripts
parent
cf81f32d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+13
-222
13 additions, 222 deletions
README.md
with
13 additions
and
222 deletions
README.md
+
13
−
222
View file @
58aeb3f5
...
@@ -263,7 +263,6 @@ query MyQuery {
...
@@ -263,7 +263,6 @@ query MyQuery {
profileCode
profileCode
layers
(
first
:
10
)
{
layers
(
first
:
10
)
{
layerId
layerId
licence
layerNumber
layerNumber
lowerDepth
lowerDepth
upperDepth
upperDepth
...
@@ -289,7 +288,7 @@ query MyQuery {
...
@@ -289,7 +288,7 @@ query MyQuery {
profileCode
profileCode
layers
(
first
:
10
)
{
layers
(
first
:
10
)
{
layerId
layerId
licenc
e
dat
e
layerNumber
layerNumber
lowerDepth
lowerDepth
upperDepth
upperDepth
...
@@ -297,7 +296,6 @@ query MyQuery {
...
@@ -297,7 +296,6 @@ query MyQuery {
siltValues
(
first
:
10
)
{
siltValues
(
first
:
10
)
{
valueAvg
valueAvg
value
value
date
}
}
}
}
}
}
...
@@ -321,7 +319,7 @@ query MyQuery {
...
@@ -321,7 +319,7 @@ query MyQuery {
profileCode
profileCode
layers
(
first
:
10
)
{
layers
(
first
:
10
)
{
layerId
layerId
licenc
e
dat
e
layerNumber
layerNumber
lowerDepth
lowerDepth
upperDepth
upperDepth
...
@@ -329,12 +327,10 @@ query MyQuery {
...
@@ -329,12 +327,10 @@ query MyQuery {
siltValues
(
first
:
10
)
{
siltValues
(
first
:
10
)
{
valueAvg
valueAvg
value
value
date
}
}
orgcValues
(
first
:
10
)
{
orgcValues
(
first
:
10
)
{
valueAvg
valueAvg
value
value
date
}
}
}
}
}
}
...
@@ -994,204 +990,11 @@ parsed <- fromJSON(content(response, "text"), flatten = TRUE)
...
@@ -994,204 +990,11 @@ parsed <- fromJSON(content(response, "text"), flatten = TRUE)
df <- as.data.frame(parsed$data$wosisLatestProfiles)
df <- as.data.frame(parsed$data$wosisLatestProfiles)
head(df)
head(df)
```
The result will be:

Using variables in our script:
- Get the __first 3 profiles__ that are __inside Gelderland region__ and add it to a Pandas dataframe:
```r
library(httr)
library(jsonlite)
geomGelderland <- list(
type = "MultiPolygon",
coordinates = list(
list(
list(
c(5.177260142422514, 51.74291774914947), c(5.126747881386732, 51.737828850498403), c(5.137580867932065, 51.772905259431077), c(5.014540023249575, 51.808984680959583), c(5.031415073146523, 51.841084802107702), c(4.993967909252922, 51.861222725420994), c(5.062358224116345, 51.859362053527242), c(5.180226727863164, 51.96744832651509), c(5.236867149255078, 51.978757478459428), c(5.321611332014112, 51.954919171164796), c(5.486214078473083, 51.98382644510454), c(5.627223829712356, 51.952386168324438), c(5.550342661060417, 52.10541954546126), c(5.459242995490565, 52.080225755481266), c(5.514079463312799, 52.135923065932062), c(5.439875615559026, 52.171197458274222), c(5.44103943147957, 52.205693438951691), c(5.393219147822698, 52.220626892173925), c(5.404643399611359, 52.249630480909225), c(5.533281176545358, 52.27274084169683), c(5.587707385036856, 52.361454261431376), c(5.787257137970521, 52.422573287061603), c(5.876205471530124, 52.522025026941051), c(5.925559518063968, 52.474057592745915), c(6.027857569808684, 52.509606205409327), c(6.099483437203417, 52.469970896552461), c(6.130552948323514, 52.399978162269164), c(6.078506385563601, 52.369523051161245), c(6.066224466859907, 52.318839289847247), c(6.163909067147507, 52.21749619292715), c(6.38185154627214, 52.246112812566473), c(6.492401220236633, 52.177371870181403), c(6.671338986248984, 52.165683203635673), c(6.662399005672591, 52.130167439615931), c(6.760572413121598, 52.118779940206082), c(6.687853003658449, 52.039856158091141), c(6.832754328999235, 51.972938087693585), c(6.721969582522561, 51.89606334135938), c(6.683993990179909, 51.91757645733221), c(6.472507886098918, 51.853823023864017), c(6.390566170881016, 51.87396806966867), c(6.401818441765064, 51.827262656663407), c(6.117889496603739, 51.901659142837225), c(6.166559884993931, 51.840721643435401), c(6.063485632339608, 51.86545122678897), c(5.962978284523374, 51.836913960582471), c(5.946569966406273, 51.813479919592751), c(5.992067051189349, 51.770245909123908), c(5.943962150919553, 51.741816814422592), c(5.893409336802974, 51.777852926426895), c(5.765188291802036, 51.752789880063702), c(5.638112608999517, 51.819025176083443), c(5.493105254357093, 51.830750957327069), c(5.403157084105017, 51.821611677731141), c(5.357568231054432, 51.757890339715857), c(5.300338754648935, 51.737287437014395), c(5.177260142422514, 51.74291774914947)
)
)
)
)
# GraphQL query
query <- "
query MyQuery($geomGelderland: GeoJSON!) {
wosisLatestProfiles(
first: 3
filter: {layersExist: true, geom: {intersects: $geomGelderland}}
) {
continent
region
profileId
datasetCode
latitude
longitude
geom {
geojson
x
y
}
}
}
"
# GraphQL endpoint
url <- "https://graphql.isric.org/wosis/graphql"
# Send POST request
response <- POST(url, body = list(query = query, variables = list(geomGelderland = geomGelderland)), encode = "json")
# Print status_code
print(status_code(response))
# Parse JSON
parsed <- fromJSON(content(response, "text"), flatten = TRUE)
# Convert to data frame
df <- as.data.frame(parsed$data$wosisLatestProfiles)
# Print data frame
print(df)
```
```
The result will be:
The result will be:

- Get __all WoSIS profiles with layers that exist in Gelderland__ and also __export it to CSV__.
```r
library(httr)
library(jsonlite)
library(dplyr)
# GeoJSON geometry
geomGelderland <- list(
type = "MultiPolygon",
coordinates = list(
list(
list(
c(5.177260142422514, 51.74291774914947), c(5.126747881386732, 51.737828850498403), c(5.137580867932065, 51.772905259431077), c(5.014540023249575, 51.808984680959583), c(5.031415073146523, 51.841084802107702), c(4.993967909252922, 51.861222725420994), c(5.062358224116345, 51.859362053527242), c(5.180226727863164, 51.96744832651509), c(5.236867149255078, 51.978757478459428), c(5.321611332014112, 51.954919171164796), c(5.486214078473083, 51.98382644510454), c(5.627223829712356, 51.952386168324438), c(5.550342661060417, 52.10541954546126), c(5.459242995490565, 52.080225755481266), c(5.514079463312799, 52.135923065932062), c(5.439875615559026, 52.171197458274222), c(5.44103943147957, 52.205693438951691), c(5.393219147822698, 52.220626892173925), c(5.404643399611359, 52.249630480909225), c(5.533281176545358, 52.27274084169683), c(5.587707385036856, 52.361454261431376), c(5.787257137970521, 52.422573287061603), c(5.876205471530124, 52.522025026941051), c(5.925559518063968, 52.474057592745915), c(6.027857569808684, 52.509606205409327), c(6.099483437203417, 52.469970896552461), c(6.130552948323514, 52.399978162269164), c(6.078506385563601, 52.369523051161245), c(6.066224466859907, 52.318839289847247), c(6.163909067147507, 52.21749619292715), c(6.38185154627214, 52.246112812566473), c(6.492401220236633, 52.177371870181403), c(6.671338986248984, 52.165683203635673), c(6.662399005672591, 52.130167439615931), c(6.760572413121598, 52.118779940206082), c(6.687853003658449, 52.039856158091141), c(6.832754328999235, 51.972938087693585), c(6.721969582522561, 51.89606334135938), c(6.683993990179909, 51.91757645733221), c(6.472507886098918, 51.853823023864017), c(6.390566170881016, 51.87396806966867), c(6.401818441765064, 51.827262656663407), c(6.117889496603739, 51.901659142837225), c(6.166559884993931, 51.840721643435401), c(6.063485632339608, 51.86545122678897), c(5.962978284523374, 51.836913960582471), c(5.946569966406273, 51.813479919592751), c(5.992067051189349, 51.770245909123908), c(5.943962150919553, 51.741816814422592), c(5.893409336802974, 51.777852926426895), c(5.765188291802036, 51.752789880063702), c(5.638112608999517, 51.819025176083443), c(5.493105254357093, 51.830750957327069), c(5.403157084105017, 51.821611677731141), c(5.357568231054432, 51.757890339715857), c(5.300338754648935, 51.737287437014395), c(5.177260142422514, 51.74291774914947)
)
)
)
)
# GraphQL query
query <- "
query MyQuery($first: Int, $offset: Int, $geomGelderland: GeoJSON!) {
wosisLatestProfiles(
first: $first,
offset: $offset,
filter: {layersExist: true, geom: {intersects: $geomGelderland}}
) {
continent
region
profileId
datasetCode
latitude
longitude
}
}
"
# GraphQL endpoint
url <- "https://graphql.isric.org/wosis/graphql"
new_results <- TRUE
first <- 100
offset <- 0
all_results <- list()
while (new_results) {
# Send POST request
response <- POST(url, body = list(query = query, variables = list(
first = first,
offset = offset, geomGelderland = geomGelderland
)), encode = "json")
# Parse JSON
parsed <- fromJSON(content(response, "text"), flatten = TRUE)
# Add results to all_results list
all_results <- append(all_results, list(parsed$data$wosisLatestProfiles))
if (!"wosisLatestProfiles" %in% names(parsed$data) || length(parsed$data$wosisLatestProfiles) == 0) {
print("No more results")
# update new_results
new_results <- FALSE
} else {
print("We have more results")
# update offset
offset <- offset + first
}
}
df <- bind_rows(all_results) %>% as_tibble()
# print dataframe
cat("There are", nrow(df), "WoSIS profiles with layers inside Gelderland region\n")
# Export dataframe to CSV
write.csv(df, "wosis_gelderland.csv", row.names = FALSE, quote = FALSE)
```
The result will be:
`There are 136 WoSIS profiles with layers inside Gelderland region`
CSV result file can be found [here](./scripts/r/wosis_gelderland.csv)
The simplest way to perform a graphQL request in r is to use {httr}.
- Get the fist 5 profiles and add it to a Pandas dataframe:
```r
library(httr)
library(jsonlite)
# GraphQL query
query <- '
query MyQuery {
wosisLatestProfiles(first: 5) {
continent
region
countryName
datasetCode
latitude
longitude
geomAccuracy
profileCode
}
}
'
# GraphQL endpoint
url <- 'https://graphql.isric.org/wosis/graphql'
# Send POST request
response <- POST(url, body = list(query = query), encode = "json")
# Print status_code
print(status_code(response))
# Parse JSON
parsed <- fromJSON(content(response, "text"), flatten = TRUE)
## convert the from json to dataframe object
df <- as.data.frame(parsed$data$wosisLatestProfiles)
head(df)
```
The result will be:


Using variables in our script:
Using variables in our script:
...
@@ -1202,17 +1005,12 @@ Using variables in our script:
...
@@ -1202,17 +1005,12 @@ Using variables in our script:
library(httr)
library(httr)
library(jsonlite)
library(jsonlite)
geomGelderland <- list(
type = "MultiPolygon",
coordinates = list(
list(
list(
c(5.177260142422514, 51.74291774914947), c(5.126747881386732, 51.737828850498403), c(5.137580867932065, 51.772905259431077), c(5.014540023249575, 51.808984680959583), c(5.031415073146523, 51.841084802107702), c(4.993967909252922, 51.861222725420994), c(5.062358224116345, 51.859362053527242), c(5.180226727863164, 51.96744832651509), c(5.236867149255078, 51.978757478459428), c(5.321611332014112, 51.954919171164796), c(5.486214078473083, 51.98382644510454), c(5.627223829712356, 51.952386168324438), c(5.550342661060417, 52.10541954546126), c(5.459242995490565, 52.080225755481266), c(5.514079463312799, 52.135923065932062), c(5.439875615559026, 52.171197458274222), c(5.44103943147957, 52.205693438951691), c(5.393219147822698, 52.220626892173925), c(5.404643399611359, 52.249630480909225), c(5.533281176545358, 52.27274084169683), c(5.587707385036856, 52.361454261431376), c(5.787257137970521, 52.422573287061603), c(5.876205471530124, 52.522025026941051), c(5.925559518063968, 52.474057592745915), c(6.027857569808684, 52.509606205409327), c(6.099483437203417, 52.469970896552461), c(6.130552948323514, 52.399978162269164), c(6.078506385563601, 52.369523051161245), c(6.066224466859907, 52.318839289847247), c(6.163909067147507, 52.21749619292715), c(6.38185154627214, 52.246112812566473), c(6.492401220236633, 52.177371870181403), c(6.671338986248984, 52.165683203635673), c(6.662399005672591, 52.130167439615931), c(6.760572413121598, 52.118779940206082), c(6.687853003658449, 52.039856158091141), c(6.832754328999235, 51.972938087693585), c(6.721969582522561, 51.89606334135938), c(6.683993990179909, 51.91757645733221), c(6.472507886098918, 51.853823023864017), c(6.390566170881016, 51.87396806966867), c(6.401818441765064, 51.827262656663407), c(6.117889496603739, 51.901659142837225), c(6.166559884993931, 51.840721643435401), c(6.063485632339608, 51.86545122678897), c(5.962978284523374, 51.836913960582471), c(5.946569966406273, 51.813479919592751), c(5.992067051189349, 51.770245909123908), c(5.943962150919553, 51.741816814422592), c(5.893409336802974, 51.777852926426895), c(5.765188291802036, 51.752789880063702), c(5.638112608999517, 51.819025176083443), c(5.493105254357093, 51.830750957327069), c(5.403157084105017, 51.821611677731141), c(5.357568231054432, 51.757890339715857), c(5.300338754648935, 51.737287437014395), c(5.177260142422514, 51.74291774914947)
)
)
)
)
geomGelderland <- fromJSON('{
"type": "MultiPolygon",
"coordinates": [ [ [ [ 5.177260142422514, 51.74291774914947 ], [ 5.126747881386732, 51.737828850498403 ], [ 5.137580867932065, 51.772905259431077 ], [ 5.014540023249575, 51.808984680959583 ], [ 5.031415073146523, 51.841084802107702 ], [ 4.993967909252922, 51.861222725420994 ], [ 5.062358224116345, 51.859362053527242 ], [ 5.180226727863164, 51.96744832651509 ], [ 5.236867149255078, 51.978757478459428 ], [ 5.321611332014112, 51.954919171164796 ], [ 5.486214078473083, 51.98382644510454 ], [ 5.627223829712356, 51.952386168324438 ], [ 5.550342661060417, 52.10541954546126 ], [ 5.459242995490565, 52.080225755481266 ], [ 5.514079463312799, 52.135923065932062 ], [ 5.439875615559026, 52.171197458274222 ], [ 5.44103943147957, 52.205693438951691 ], [ 5.393219147822698, 52.220626892173925 ], [ 5.404643399611359, 52.249630480909225 ], [ 5.533281176545358, 52.27274084169683 ], [ 5.587707385036856, 52.361454261431376 ], [ 5.787257137970521, 52.422573287061603 ], [ 5.876205471530124, 52.522025026941051 ], [ 5.925559518063968, 52.474057592745915 ], [ 6.027857569808684, 52.509606205409327 ], [ 6.099483437203417, 52.469970896552461 ], [ 6.130552948323514, 52.399978162269164 ], [ 6.078506385563601, 52.369523051161245 ], [ 6.066224466859907, 52.318839289847247 ], [ 6.163909067147507, 52.21749619292715 ], [ 6.38185154627214, 52.246112812566473 ], [ 6.492401220236633, 52.177371870181403 ], [ 6.671338986248984, 52.165683203635673 ], [ 6.662399005672591, 52.130167439615931 ], [ 6.760572413121598, 52.118779940206082 ], [ 6.687853003658449, 52.039856158091141 ], [ 6.832754328999235, 51.972938087693585 ], [ 6.721969582522561, 51.89606334135938 ], [ 6.683993990179909, 51.91757645733221 ], [ 6.472507886098918, 51.853823023864017 ], [ 6.390566170881016, 51.87396806966867 ], [ 6.401818441765064, 51.827262656663407 ], [ 6.117889496603739, 51.901659142837225 ], [ 6.166559884993931, 51.840721643435401 ], [ 6.063485632339608, 51.86545122678897 ], [ 5.962978284523374, 51.836913960582471 ], [ 5.946569966406273, 51.813479919592751 ], [ 5.992067051189349, 51.770245909123908 ], [ 5.943962150919553, 51.741816814422592 ], [ 5.893409336802974, 51.777852926426895 ], [ 5.765188291802036, 51.752789880063702 ], [ 5.638112608999517, 51.819025176083443 ], [ 5.493105254357093, 51.830750957327069 ], [ 5.403157084105017, 51.821611677731141 ], [ 5.357568231054432, 51.757890339715857 ], [ 5.300338754648935, 51.737287437014395 ], [ 5.177260142422514, 51.74291774914947 ] ] ] ]
}
')
# GraphQL query
# GraphQL query
query <- "
query <- "
...
@@ -1252,7 +1050,7 @@ parsed <- fromJSON(content(response, "text"), flatten = TRUE)
...
@@ -1252,7 +1050,7 @@ parsed <- fromJSON(content(response, "text"), flatten = TRUE)
df <- as.data.frame(parsed$data$wosisLatestProfiles)
df <- as.data.frame(parsed$data$wosisLatestProfiles)
# Print data frame
# Print data frame
print
(df)
head
(df)
```
```
...
@@ -1269,16 +1067,11 @@ library(jsonlite)
...
@@ -1269,16 +1067,11 @@ library(jsonlite)
library(dplyr)
library(dplyr)
# GeoJSON geometry
# GeoJSON geometry
geomGelderland <- list(
geomGelderland <- fromJSON('{
type = "MultiPolygon",
"type": "MultiPolygon",
coordinates = list(
"coordinates": [ [ [ [ 5.177260142422514, 51.74291774914947 ], [ 5.126747881386732, 51.737828850498403 ], [ 5.137580867932065, 51.772905259431077 ], [ 5.014540023249575, 51.808984680959583 ], [ 5.031415073146523, 51.841084802107702 ], [ 4.993967909252922, 51.861222725420994 ], [ 5.062358224116345, 51.859362053527242 ], [ 5.180226727863164, 51.96744832651509 ], [ 5.236867149255078, 51.978757478459428 ], [ 5.321611332014112, 51.954919171164796 ], [ 5.486214078473083, 51.98382644510454 ], [ 5.627223829712356, 51.952386168324438 ], [ 5.550342661060417, 52.10541954546126 ], [ 5.459242995490565, 52.080225755481266 ], [ 5.514079463312799, 52.135923065932062 ], [ 5.439875615559026, 52.171197458274222 ], [ 5.44103943147957, 52.205693438951691 ], [ 5.393219147822698, 52.220626892173925 ], [ 5.404643399611359, 52.249630480909225 ], [ 5.533281176545358, 52.27274084169683 ], [ 5.587707385036856, 52.361454261431376 ], [ 5.787257137970521, 52.422573287061603 ], [ 5.876205471530124, 52.522025026941051 ], [ 5.925559518063968, 52.474057592745915 ], [ 6.027857569808684, 52.509606205409327 ], [ 6.099483437203417, 52.469970896552461 ], [ 6.130552948323514, 52.399978162269164 ], [ 6.078506385563601, 52.369523051161245 ], [ 6.066224466859907, 52.318839289847247 ], [ 6.163909067147507, 52.21749619292715 ], [ 6.38185154627214, 52.246112812566473 ], [ 6.492401220236633, 52.177371870181403 ], [ 6.671338986248984, 52.165683203635673 ], [ 6.662399005672591, 52.130167439615931 ], [ 6.760572413121598, 52.118779940206082 ], [ 6.687853003658449, 52.039856158091141 ], [ 6.832754328999235, 51.972938087693585 ], [ 6.721969582522561, 51.89606334135938 ], [ 6.683993990179909, 51.91757645733221 ], [ 6.472507886098918, 51.853823023864017 ], [ 6.390566170881016, 51.87396806966867 ], [ 6.401818441765064, 51.827262656663407 ], [ 6.117889496603739, 51.901659142837225 ], [ 6.166559884993931, 51.840721643435401 ], [ 6.063485632339608, 51.86545122678897 ], [ 5.962978284523374, 51.836913960582471 ], [ 5.946569966406273, 51.813479919592751 ], [ 5.992067051189349, 51.770245909123908 ], [ 5.943962150919553, 51.741816814422592 ], [ 5.893409336802974, 51.777852926426895 ], [ 5.765188291802036, 51.752789880063702 ], [ 5.638112608999517, 51.819025176083443 ], [ 5.493105254357093, 51.830750957327069 ], [ 5.403157084105017, 51.821611677731141 ], [ 5.357568231054432, 51.757890339715857 ], [ 5.300338754648935, 51.737287437014395 ], [ 5.177260142422514, 51.74291774914947 ] ] ] ]
list(
}
list(
')
c(5.177260142422514, 51.74291774914947), c(5.126747881386732, 51.737828850498403), c(5.137580867932065, 51.772905259431077), c(5.014540023249575, 51.808984680959583), c(5.031415073146523, 51.841084802107702), c(4.993967909252922, 51.861222725420994), c(5.062358224116345, 51.859362053527242), c(5.180226727863164, 51.96744832651509), c(5.236867149255078, 51.978757478459428), c(5.321611332014112, 51.954919171164796), c(5.486214078473083, 51.98382644510454), c(5.627223829712356, 51.952386168324438), c(5.550342661060417, 52.10541954546126), c(5.459242995490565, 52.080225755481266), c(5.514079463312799, 52.135923065932062), c(5.439875615559026, 52.171197458274222), c(5.44103943147957, 52.205693438951691), c(5.393219147822698, 52.220626892173925), c(5.404643399611359, 52.249630480909225), c(5.533281176545358, 52.27274084169683), c(5.587707385036856, 52.361454261431376), c(5.787257137970521, 52.422573287061603), c(5.876205471530124, 52.522025026941051), c(5.925559518063968, 52.474057592745915), c(6.027857569808684, 52.509606205409327), c(6.099483437203417, 52.469970896552461), c(6.130552948323514, 52.399978162269164), c(6.078506385563601, 52.369523051161245), c(6.066224466859907, 52.318839289847247), c(6.163909067147507, 52.21749619292715), c(6.38185154627214, 52.246112812566473), c(6.492401220236633, 52.177371870181403), c(6.671338986248984, 52.165683203635673), c(6.662399005672591, 52.130167439615931), c(6.760572413121598, 52.118779940206082), c(6.687853003658449, 52.039856158091141), c(6.832754328999235, 51.972938087693585), c(6.721969582522561, 51.89606334135938), c(6.683993990179909, 51.91757645733221), c(6.472507886098918, 51.853823023864017), c(6.390566170881016, 51.87396806966867), c(6.401818441765064, 51.827262656663407), c(6.117889496603739, 51.901659142837225), c(6.166559884993931, 51.840721643435401), c(6.063485632339608, 51.86545122678897), c(5.962978284523374, 51.836913960582471), c(5.946569966406273, 51.813479919592751), c(5.992067051189349, 51.770245909123908), c(5.943962150919553, 51.741816814422592), c(5.893409336802974, 51.777852926426895), c(5.765188291802036, 51.752789880063702), c(5.638112608999517, 51.819025176083443), c(5.493105254357093, 51.830750957327069), c(5.403157084105017, 51.821611677731141), c(5.357568231054432, 51.757890339715857), c(5.300338754648935, 51.737287437014395), c(5.177260142422514, 51.74291774914947)
)
)
)
)
# GraphQL query
# GraphQL query
query <- "
query <- "
...
@@ -1334,7 +1127,6 @@ cat("There are", nrow(df), "WoSIS profiles with layers inside Gelderland region\
...
@@ -1334,7 +1127,6 @@ cat("There are", nrow(df), "WoSIS profiles with layers inside Gelderland region\
# Export dataframe to CSV
# Export dataframe to CSV
write.csv(df, "wosis_gelderland.csv", row.names = FALSE, quote = FALSE)
write.csv(df, "wosis_gelderland.csv", row.names = FALSE, quote = FALSE)
```
```
The result will be:
The result will be:
...
@@ -1342,5 +1134,4 @@ The result will be:
...
@@ -1342,5 +1134,4 @@ The result will be:
CSV result file can be found [here](./scripts/r/wosis_gelderland.csv)
CSV result file can be found [here](./scripts/r/wosis_gelderland.csv)
----------
----------
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment