diff --git a/.github/scripts/merge_csv_to_topojson.py b/.github/scripts/merge_csv_to_topojson.py index 352f499..bd73eba 100644 --- a/.github/scripts/merge_csv_to_topojson.py +++ b/.github/scripts/merge_csv_to_topojson.py @@ -10,7 +10,7 @@ geo = open(topojson_file, 'r') # open the topo.json file json_data = json.loads(geo.read()) # read the file and load into a dict # for each feature, if the name in the json matches the name in the csv, add new properties to the json -for feature in json_data['objects']['boundaries']['geometries']: +for feature in json_data['objects']['boundaries.geo']['geometries']: with open(csv_file, newline='') as f: # use DictReader so we can use the header names reader = csv.DictReader(f) diff --git a/.github/scripts/minify-map-json.sh b/.github/scripts/minify-map-json.sh deleted file mode 100644 index 08b52c4..0000000 --- a/.github/scripts/minify-map-json.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -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 \ No newline at end of file diff --git a/.github/workflows/merge-csv-to-topojson.yml b/.github/workflows/merge-csv-to-topojson.yml index 47a8e94..67af72a 100644 --- a/.github/workflows/merge-csv-to-topojson.yml +++ b/.github/workflows/merge-csv-to-topojson.yml @@ -5,7 +5,6 @@ on: - master paths: - website/data/library_services_information.csv - - website/data/boundaries.topo.json jobs: mergeData: runs-on: ubuntu-latest diff --git a/.github/workflows/minify-map-json.yml b/.github/workflows/minify-map-json.yml index a1bcf04..58fce2d 100644 --- a/.github/workflows/minify-map-json.yml +++ b/.github/workflows/minify-map-json.yml @@ -19,6 +19,7 @@ jobs: 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: