-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparseRDWData.js
23 lines (21 loc) · 972 Bytes
/
parseRDWData.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require('@babel/register')({
presets: ['@babel/preset-env'],
})
const fs = require('fs')
const { andThen, pipe } = require('ramda')
const { parkingAreaMapper } = require('./src/helpers/RDWData.js')
const { fetchAndParseMultipleJson } = require('./src/modules/fetch.js')
parseRDWData([
"https://opendata.rdw.nl/resource/adw6-9hsg.json?$limit=10000&$where=usageid!='VERGUNP'", // parking areas
"https://opendata.rdw.nl/resource/qidm-7mkf.json?$limit=10000&$where=usageid!='VERGUNP'", // usage goal
'https://opendata.rdw.nl/resource/b3us-f26s.json?$limit=10000', // area specifications
'https://opendata.rdw.nl/resource/nsk3-v9n7.json?$limit=10000', // geometry parking area
'https://opendata.rdw.nl/resource/edv8-qiyg.json?$limit=10000', // parking entrance
])
async function parseRDWData(uri) {
const data = await pipe(
fetchAndParseMultipleJson,
andThen(parkingAreaMapper)
)(uri)
fs.writeFileSync('./src/rdw-data.json', JSON.stringify(data))
}