Data explorer

Explore our data! Click "Run" and wait a few seconds to see the map.

var turf = require("@turf/turf"); var getJSON = require("async-get-json"); var greenspaces = await getJSON("https://greenspacehack.com/data/summary.geojson"); // When the last statement results in a GeoJSON output, it'll appear on a map...

Filtering the data

Try a simple query. Copy this line then paste it at the end of the code box above, then click "Run" again.

greenspaces.features.filter(feature => (feature.properties['NESTLIKERT'] '').includes("Very_Satisfied"))

This filters the greenspace features to only select those where the satisfaction score (code "NESTLIKERT") was "Very_Satisfied".

We're using RunKit, which provides a "live" JavaScript environment in which you can write code that interacts with our data. All npm modules are available, including the Turf geospatial analysis library. You'll see in the above example that RunKit always outputs the result of the last statement in the code. Because this result is a GeoJSON object, RunKit is smart enough to show it on a map.

Working with our data

We provide an easy-to-use data dump in JSON format for you to experiment with. By using RunKit's live REPL (read-eval-print loop) coding environment, you can experiment with it in your browser. Just use JavaScript to slice and dice the data, and the results will be visualised on a browsable map.

You'll find these files useful:

  • https://greenspacehack.com/data/full.geojson - GeoJSON of all sites. Properties include 'name', 'town', and answers to all e-NEST survey questions.
  • https://greenspacehack.com/data/summary.geojson - GeoJSON of all sites but without full answers.
  • https://greenspacehack.com/data/oxfordshire_lsoas.geojson - GeoJSON of all LSOAs in Oxfordshire (census Lower Layer Super Output Areas). Each centroid point represents a number of residents as expressed in the 'population' property (typically 1000-1500 but may be more). We have enhanced this with the Index of Multiple Deprivation 2015 scores (properties 'multiple','children','crime','education','environment','employment', 'health','housing_services','income','older_people').
  • https://greenspacehack.com/data/survey.json is the list of questions and possible answers. You probably won't want to load this into your RunKit code, but it'll show you what properties you can query, and what the possible values are.

We have a permissive CORS policy on these files, so we encourage you to load them into your projects. You can create notebooks in RunKit using our examples as a starting point.

Examples

Here's two examples of simple analysis using our data in the RunKit environment: