aboutsummaryrefslogtreecommitdiff
path: root/bin/building.js
diff options
context:
space:
mode:
authorAndrew Harvey <andrew@alantgeo.com.au>2021-06-10 13:41:37 +1000
committerAndrew Harvey <andrew@alantgeo.com.au>2021-06-10 13:41:37 +1000
commit91fa58f564e4c2fb24b1446e659e47701caea884 (patch)
tree1397438ff9ef45b208eb5378c210524d4f0f6cef /bin/building.js
parent70523db4413644c3b10398ffda966786d231905b (diff)
reorder features and set ids for better maproulette tasks
Diffstat (limited to 'bin/building.js')
-rwxr-xr-xbin/building.js23
1 files changed, 18 insertions, 5 deletions
diff --git a/bin/building.js b/bin/building.js
index f991be2..c405cdb 100755
--- a/bin/building.js
+++ b/bin/building.js
@@ -116,12 +116,17 @@ const conflate = new Transform({
const task = {
type: 'FeatureCollection',
features: [
+ ...nearbyMatchedFeatures.map(f => {
+ // MapRoulette uses the first feature id as the task ID
+ f.id = feature.id
+ return f
+ }),
+ // last feature is used as the first one shown in MapRoulette
point(feature.geometry.coordinates, Object.assign({}, feature.properties, {
'marker-color': 'orange',
'marker-size': 'large',
'OSM Name': nearbyMatchedFeatures[0].properties.name
- }, properties)),
- ...nearbyMatchedFeatures
+ }, properties))
]
}
outputStreams.mr_singleNearbySimilarFeature.write(task)
@@ -131,11 +136,16 @@ const conflate = new Transform({
const task = {
type: 'FeatureCollection',
features: [
+ ...nearbyMatchedFeatures.map(f => {
+ // MapRoulette uses the first feature id as the task ID
+ f.id = feature.id
+ return f
+ }),
+ // last feature is used as the first one shown in MapRoulette
point(feature.geometry.coordinates, Object.assign({}, feature.properties, {
'marker-color': 'orange',
'marker-size': 'large'
- }, properties)),
- ...nearbyMatchedFeatures
+ }, properties))
]
}
outputStreams.mr_multipleNearbySimilarFeatures.write(task)
@@ -144,7 +154,10 @@ const conflate = new Transform({
const task = {
type: 'FeatureCollection',
features: [
- point(feature.geometry.coordinates, Object.assign({}, feature.properties, properties))
+ point(feature.geometry.coordinates, Object.assign({}, feature.properties, properties), {
+ // MapRoulette uses the first feature id as the task ID
+ id: feature.id
+ })
]
}
outputStreams.mr_noNearbySimilarFeature.write(task)