Skip to content

Commit

Permalink
Merge branch 'main' into maintainance
Browse files Browse the repository at this point in the history
  • Loading branch information
shuaiey committed Sep 27, 2022
2 parents 36e16ee + 1a4f96e commit fc6e454
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 20 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
name: Build Files
on:
push:
tags-ignore:
- v[0-9]+.[0-9]+.[0-9]+*
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "14.x"
node-version: "18.x"
registry-url: https://registry.npmjs.com
- run: yarn --frozen-lockfile

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "14.x"
node-version: "18.x"
registry-url: https://registry.npmjs.com
- run: yarn --frozen-lockfile

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "14.x"
node-version: "18.x"
registry-url: https://registry.npmjs.com
- run: yarn --frozen-lockfile

Expand Down
22 changes: 15 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# https://www.bfs.admin.ch/bfs/de/home/dienstleistungen/geostat/geodaten-bundesstatistik/administrative-grenzen/generalisierte-gemeindegrenzen.html
#

YEARS := 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2021-04 2021-07 2022
YEARS := 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2021-04 2021-07 2022 2022-05
SHAPES := country cantons districts municipalities lakes
SHAPEFILE_EXT := shp dbf prj shx

Expand Down Expand Up @@ -72,8 +72,8 @@ SHAPEFILE_TARGETS := $(foreach shape,$(SHAPES),20%/$(shape).shp)
yarn run mapshaper \
-i $< \
-clean \
-each 'id=this.properties.BZNR || this.properties.BEZIRK; name=this.properties.BZNAME || this.properties.NAME' \
-filter-fields id,name \
-each 'id=this.properties.BZNR || this.properties.BEZIRK; name=this.properties.BZNAME || this.properties.NAME; KTNR=this.properties.KTNR || this.properties.KT' \
-filter-fields id,name,KTNR \
-o format=shapefile encoding=utf8 $@

# Clean up municipalities
Expand All @@ -84,8 +84,8 @@ SHAPEFILE_TARGETS := $(foreach shape,$(SHAPES),20%/$(shape).shp)
yarn run mapshaper \
-i $< $(if $(findstring 2017,$@),encoding=win1252,) \
-clean \
-each 'id=this.properties.GMDNR || this.properties.GMDE; name=this.properties.GMDNAME || this.properties.NAME' \
-filter-fields id,name \
-each 'id=this.properties.GMDNR || this.properties.GMDE; name=this.properties.GMDNAME || this.properties.NAME; KTNR=this.properties.KTNR || this.properties.KT' \
-filter-fields id,name,KTNR \
-filter '+id < 7000' \
-o format=shapefile encoding=utf8 $@

Expand Down Expand Up @@ -167,7 +167,15 @@ shapefile/2021/$(1).$(2): downloads/2021.zip

shapefile/2022/$(1).$(2): downloads/2022.zip
@mkdir -p $$(dir $$@)
unzip -p $$< ggg_2022_LV95/shp/g1$(1)22.$(2) > $$@
unzip -p $$< ag-b-00.03-875-gg22/ggg_2022_LV95/shp/g1$(1)22.$(2) > $$@

shapefile/2022-05/g.$(2): downloads/2022.zip
@mkdir -p $$(dir $$@)
unzip -p $$< ag-b-00.03-875-gg22/ggg_2022_LV95/shp/g1g22_20220501.$(2) > $$@

shapefile/2022-05/$(1).$(2): downloads/2022.zip
@mkdir -p $$(dir $$@)
unzip -p $$< ag-b-00.03-875-gg22/ggg_2022_LV95/shp/g1$(1)22.$(2) > $$@

# Files from 2018 on seem to be consistently structured
shapefile/20%/$(1).$(2): downloads/20%.zip
Expand All @@ -192,7 +200,7 @@ $(foreach type,g k l s b,$(foreach ext,$(SHAPEFILE_EXT),$(eval $(call extract_fr

downloads/2022.zip:
mkdir -p $(dir $@)
curl -o $@ "https://www.bfs.admin.ch/bfsstatic/dam/assets/21224783/master"
curl -o $@ "https://dam-api.bfs.admin.ch/hub/api/dam/assets/22484210/master"

downloads/2021.zip:
mkdir -p $(dir $@)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "swiss-maps",
"version": "4.2.0",
"version": "4.3.0",
"description": "Swiss geodata as TopoJSON.",
"license": "bsd-3-clause",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@material-ui/core": "^4.12.4",
"@types/cors": "^2.8.12",
"@types/d3": "^7.4.0",
"@types/node": "^18.0.0",
"@types/node": "^18.7.18",
"@types/react": "^16.9.55",
"@types/topojson": "^3.2.3",
"bezier-easing": "^2.1.0",
Expand Down
8 changes: 4 additions & 4 deletions website/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -580,10 +580,10 @@
resolved "https://registry.yarnpkg.com/@types/geojson/-/geojson-7946.0.7.tgz#c8fa532b60a0042219cdf173ca21a975ef0666ad"
integrity sha512-wE2v81i4C4Ol09RtsWFAqg3BUitWbHSpSlIo+bNdsCJijO9sjme+zm+73ZMCa/qMC8UEERxzGbvmr1cffo2SiQ==

"@types/node@*", "@types/node@^18.0.0":
version "18.0.0"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.0.0.tgz#67c7b724e1bcdd7a8821ce0d5ee184d3b4dd525a"
integrity sha512-cHlGmko4gWLVI27cGJntjs/Sj8th9aYwplmZFwmmgYQQvL5NUsgVJG7OddLvNfLqYS31KFN0s3qlaD9qCaxACA==
"@types/node@*", "@types/node@^18.7.18":
version "18.7.18"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.18.tgz#633184f55c322e4fb08612307c274ee6d5ed3154"
integrity sha512-m+6nTEOadJZuTPkKR/SYK3A2d7FZrgElol9UP1Kae90VVU4a6mxnPuLiIW1m4Cq4gZ/nWb9GrdVXJCoCazDAbg==

"@types/node@^10.0.3":
version "10.17.44"
Expand Down

0 comments on commit fc6e454

Please sign in to comment.