public_library_map/.github/workflows/minify-map-json.yml

42 lines
1.2 KiB
YAML
Raw Normal View History

name: Minify Map JSON
on:
push:
branches:
- master
paths:
2021-01-28 18:42:47 +11:00
- 'boundaries.geo.json'
workflow_dispatch:
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
2021-01-28 19:56:57 +11:00
- 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
process:
needs: prepare
runs-on: ubuntu-latest
steps:
- name: Update TopoJSON boundaries
run: |
sudo npm install -g topojson-server
geo2topo ./boundaries.geo.json -q 50000 > ./website/data/boundaries.topo.json
merge:
needs: process
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
2021-01-28 19:56:57 +11:00
branch: geo-to-topo