Merge pull request #46 from hughrun/geo2topo

Geo2topo
This commit is contained in:
Hugh Rundle 2021-01-28 18:29:40 +11:00 committed by GitHub
commit e8163c68b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 0 deletions

4
.github/scripts/minify-map-json.sh vendored Normal file
View file

@ -0,0 +1,4 @@
npm install -g mapshaper
mapshaper ./boundaries.geo.json snap -clean -o force precision=0.0001 format=geojson ./boundaries.geo.json
npm install -g topojson-server
geo2topo ./boundaries.geo.json -q 50000 > ./website/data/boundaries.topo.json

30
.github/workflows/minify-map-json.yml vendored Normal file
View file

@ -0,0 +1,30 @@
name: Minify Map JSON
on:
push:
branches:
- master
paths:
- ./boundaries.geo.json
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Update TopoJSON boundaries
run: ./.github/scripts/minify-map-json.sh
merge:
needs: prepare
runs-on: ubuntu-latest
steps:
- name: Merge CSV to TopoJSON
run: |
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