diff options
author | Andrew Harvey <andrew@alantgeo.com.au> | 2021-05-25 16:20:33 +1000 |
---|---|---|
committer | Andrew Harvey <andrew@alantgeo.com.au> | 2021-05-25 16:20:33 +1000 |
commit | 7a96eb03b334489a38ac29f7a65ba71891557492 (patch) | |
tree | 103b313b0d6f26de3bd35b71fe7153cf9ced94f5 | |
parent | c2a6a3a4d1077e084717d722c792b04ca0138644 (diff) |
output maproulette challange for addresses which matched due to inside a polygon but have different tags
-rwxr-xr-x | bin/conflate.js | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/bin/conflate.js b/bin/conflate.js index a7c53bc..7c3e222 100755 --- a/bin/conflate.js +++ b/bin/conflate.js @@ -187,6 +187,29 @@ const conflate = new Transform({ feature.properties._osmid = osmPoly.properties['@id'] outputStreams.withinExistingOSMAddressPoly.write(feature) + + // MapRoulette task + const task = { + type: 'FeatureCollection', + features: [ feature ], + cooperativeWork: { + meta: { + version: 2, + type: 1 // tag fix type + }, + operations: [{ + operationType: 'modifyElement', + data: { + id: `${osmPoly.properties['@type']}/${osmPoly.properties['@id']}`, + operations: [{ + operation: 'setTags', + data: feature.properties + }] + } + }] + } + } + outputStreams.mr_withinExistingOSMAddressPoly.write(task) } else { // address not found within an existing OSM address polygon outputStreams.noExactMatch.write(feature) @@ -210,7 +233,7 @@ const conflate = new Transform({ }) // ndjson streams to output features -const outputKeys = ['notFoundInBlocks', 'noExactMatch', 'exactMatch', 'exactMatchLines', 'withinExistingOSMAddressPoly', 'noOSMAddressWithinBlock'] +const outputKeys = ['notFoundInBlocks', 'noExactMatch', 'exactMatch', 'exactMatchLines', 'mr_withinExistingOSMAddressPoly', 'withinExistingOSMAddressPoly', 'noOSMAddressWithinBlock'] const outputStreams = {} const outputStreamOutputs = {} |