diff options
author | Andrew Harvey <andrew@alantgeo.com.au> | 2021-06-14 21:36:40 +1000 |
---|---|---|
committer | Andrew Harvey <andrew@alantgeo.com.au> | 2021-06-14 21:36:40 +1000 |
commit | 77fe58154a09c89aaf41a4cd0a0b892fe38477b5 (patch) | |
tree | c4ff5c89efd964e51cd28fcb333ecc82f3d77035 | |
parent | 70459c21bc1243f1900cb20dd2cc722636fcd8da (diff) |
set Vicmap Address changeset tags in mr2osc
-rwxr-xr-x | bin/mr2osc.mjs | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/bin/mr2osc.mjs b/bin/mr2osc.mjs index 25f008e..7256624 100755 --- a/bin/mr2osc.mjs +++ b/bin/mr2osc.mjs @@ -52,6 +52,13 @@ const CREATED_BY = 'https://gitlab.com/alantgeo/vicmap2osm' const AUTHORIZATION = `Basic ${Buffer.from(process.env.OSM_USERNAME + ':' + process.env.OSM_PASSWORD).toString('base64')}` let MAXIMUM_ELEMENTS_PER_UPLOAD_REQUEST = 10000 +const changesetTags = { + created_by: CREATED_BY, + comment: argv.changesetComment, + source: 'Vicmap Address', + 'source:ref': 'https://www.land.vic.gov.au/maps-and-spatial/spatial-data/vicmap-catalogue/vicmap-address' +} + console.log(`Retrieving capabilities from ${OSM_API_WRITE}`) await fetch(`${OSM_API_WRITE}/api/capabilities`, { headers: { @@ -291,20 +298,14 @@ async function uploadChanges() { }, osm: { changeset: { - tag: [ - { - _attributes: { - k: 'created_by', - v: CREATED_BY - } - }, - { + tag: Object.keys(changesetTags).map(key => { + return { _attributes: { - k: 'comment', - v: argv.changesetComment + k: key, + v: changesetTags[key] } } - ] + }) } } }, Object.assign({compact: true}, argv.dryRun ? { spaces: 2 } : {})) |