Compare Greenspace Hack data against LSOAs

node v9.11.2
version: master
endpointsharetweet
This demonstrates using Turf to compare Greenspace Hack data against an external dataset.
var turf = require("@turf/turf"); var getJSON = require("async-get-json"); var greenspaces = await getJSON("https://greenspacehack.com/data/sites_grouped.geojson"); var lsoas = await getJSON("https://greenspacehack.com/data/oxfordshire_lsoas.geojson"); // Find the most deprived LSOAs with no greenspace within 1km var deprived = []; turf.featureEach(lsoas, function(feature,index) { if (feature.properties.multiple<20) return; var nearestGreenspace = turf.nearestPoint(feature, greenspaces); if (turf.distance(feature,nearestGreenspace)>=1) deprived.push(feature); }); // Show on a map deprived;
Loading…

no comments

    sign in to comment