public_library_map/.github/workflows/minify-map-json.yml
Hugh Rundle 92ad548b92 fix Action workflows
- fix incorrect key name in merge file (json_data['objects']['boundaries.geo'] rather than json_data['objects']['boundaries'])
- don't merge csv and topo.json when topo.json changes, as this will create an infinite loop
- run merge as part of geo-to-topo Action, after new topo file is created
- remove redundant shell file
2021-01-29 08:28:40 +11:00

30 lines
945 B
YAML

name: Minify Map JSON
on:
push:
branches:
- master
paths:
- 'boundaries.geo.json'
workflow_dispatch:
jobs:
processJson:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Update GeoJSON boundaries
run: |
sudo npm install -g mapshaper
mapshaper boundaries.geo.json snap -clean -o force precision=0.0001 format=geojson boundaries.geo.json
sudo npm install -g topojson-server
geo2topo boundaries.geo.json -q 50000 > website/data/boundaries.topo.json
python3 ./.github/scripts/merge_csv_to_topojson.py
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
commit-message: Update TopoJSON boundaries
title: Update TopoJSON boundaries
body: Clean and minify GeoJSON and process to TopoJSON
branch: geo-to-topo