Confirm that turf-voroni does not alter feature order

node v8.17.0
version: 0.1.0
endpointsharetweet
var t=require('@turf/turf'); var p = t.randomPoint(100); p.features.forEach((f,i) => f.properties.num=i); var v = t.voronoi(p,{bbox: [-180, -90, 180, 90]}) v.features.forEach((f,i) => f.properties.num=i); var ok = true; var bad = []; v.features.forEach((f,i) => { if (!t.booleanWithin(p.features[i], f)) { ok = false; bad.push(f); bad.push(p.features[i]); } }); if (!ok) { JSON.stringify(t.featureCollection(bad)); } else { 'All good'; }
Loading…

no comments

    sign in to comment