Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

Find good playgrounds

node v10.24.1
version: master
endpointsharetweet
This demonstrates simple filtering - just showing those greenspaces that include a playground and with which the assessor was satisfied.
var getJSON = require("async-get-json"); var greenspaces = await getJSON("https://greenspacehack.com/data/sites_grouped.geojson"); var playgrounds = greenspaces.features.filter(feature => feature.properties['R1P'].includes("Yes")) var good_playgrounds = playgrounds.filter(feature => feature.properties['NESTLIKERT'].includes("Very Satisfied") || feature.properties['NESTLIKERT'].includes("Satisfied"))
We can output the results as an HTML table, too.
var rows = good_playgrounds.map(function(feature) { return `<tr><td>${feature.properties.name}<td>${feature.properties.town}`; }); `<table>${rows.join('')}</table>`
Loading…

no comments

    sign in to comment