From 7a96eb03b334489a38ac29f7a65ba71891557492 Mon Sep 17 00:00:00 2001 From: Andrew Harvey Date: Tue, 25 May 2021 16:20:33 +1000 Subject: output maproulette challange for addresses which matched due to inside a polygon but have different tags --- bin/conflate.js | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'bin/conflate.js') 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 = {} -- cgit v1.2.3