Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
Find good playgrounds
node v10.24.1
version:
master
endpoint
share
tweet
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