Skip to content

Instantly share code, notes, and snippets.

@scw
Last active January 26, 2016 00:22
Show Gist options
  • Save scw/f761b6c5fe2508eeb94c to your computer and use it in GitHub Desktop.
Save scw/f761b6c5fe2508eeb94c to your computer and use it in GitHub Desktop.
Download Singapore region data
#!/usr/bin/env bash
# source map: http://www.arcgis.com/home/item.html?id=0dd32a9c77b8400ebf60261571b9134b
echo "You must abide by the terms of use of this data:"
echo " https://ref.data.gov.sg/common/terms.aspx"
echo "Agree to terms? (y|n)"
read input
if [ ${input} == 'y' ]; then
# the 5 URA planning regions
curl -o singapore_planning_regions.json "http://services3.arcgis.com/Re1MinHTcwPKQnS5/arcgis/rest/services/URA_MP2014_BOUNDARY_MAP/FeatureServer/2/query?where=1%3D1&returnIdsOnly=false&returnCountOnly=false&f=pjson"
# assumes GDAL is installed; convert to Shapefile
ogr2ogr singapore_planning_regions.shp singapore_planning_regions.json
# 55 URA administrative areas:
curl -o singapore_planning_areas.json "http://services3.arcgis.com/Re1MinHTcwPKQnS5/arcgis/rest/services/URA_MP2014_BOUNDARY_MAP/FeatureServer/1/query?where=1%3D1&returnIdsOnly=false&returnCountOnly=false&f=pjson"
#
ogr2ogr singapore_planning_areas.shp singapore_planning_areas.json
else
echo "aborting."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment