Skip to content

cheeaun/sgtreesdata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SG Trees Data

Singapore Trees data

This is a data-only repository to complement ExploreTrees.SG.

The data

It's in the data/ folder.

Data pipeline

Requirements

Collection

  • npm run trees - fetch all raw tree data from Trees.SG and generate grid-*.json files in the data/grid folder.
  • npm run family - fetch family categories for the trees, and generate species-info.json, families-species.json and families.json.
  • npm run pois - fetch Points of Interets, mainly the parks, community gardens, heritage roads and skyrise greeneries.

Preparation

  • npm run chunk - read all the raw data and generate a cleaner trees-everything.geojson (NOT included in this repository).
  • npm run minify - generate minified/compressed data (excludes flowering and heritage data) from trees-everything.geojson into:
    • trees.min.json
      • Data with two keys; line and props.
      • line = All tree coordinates combined into a single line encoded with the Encoded Polyline Algorithm Format.
      • props = All other values from GeoJSON feature.properties
    • trees.min.mp.ico (NOT included in this repository)
      • Same as trees.min.json but compressed with MessagePack.
      • .ico file extension is used to mask the .mp extension which is actually a MessagePack file. It's NOT an icon file and the .ico file extension is meant to fool the server to apply Gzip/Brotli compression on it, since there's no official MIME type for MessagePack. GitHub Pages serves .mp as uncompressed application/octet-stream. Cloudflare compresses image/x-icon.
    • trees.csv - same as trees-everything.geojson but in CSV format. Includes raw coordinates.
    • trees.line.txt - same as line from trees.min.json but in plain text.
    • trees-no-coords.csv - same as trees.csv but without coordinates.
    • heritage-trees.json - list of tree IDs that are in the Heritage Trees list.
  • npm run tiles

Copyright