{"id":13406022,"url":"https://github.com/interactivethings/swiss-maps","last_synced_at":"2025-04-04T22:08:42.205Z","repository":{"id":5542639,"uuid":"6746451","full_name":"interactivethings/swiss-maps","owner":"interactivethings","description":"Swiss geodata as TopoJSON","archived":false,"fork":false,"pushed_at":"2024-04-06T07:46:36.000Z","size":170977,"stargazers_count":224,"open_issues_count":2,"forks_count":43,"subscribers_count":15,"default_branch":"main","last_synced_at":"2024-04-14T06:03:46.273Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"swiss-maps.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/interactivethings.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2012-11-18T12:26:17.000Z","updated_at":"2024-04-26T10:50:32.479Z","dependencies_parsed_at":"2023-12-30T05:23:35.268Z","dependency_job_id":"47b85eb5-8441-45e4-bdf7-050aab176d37","html_url":"https://github.com/interactivethings/swiss-maps","commit_stats":{"total_commits":313,"total_committers":12,"mean_commits":"26.083333333333332","dds":0.4568690095846646,"last_synced_commit":"9198ad9be11e9c114d5726073adb0cb50e8cea51"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interactivethings%2Fswiss-maps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interactivethings%2Fswiss-maps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interactivethings%2Fswiss-maps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interactivethings%2Fswiss-maps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/interactivethings","download_url":"https://codeload.github.com/interactivethings/swiss-maps/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247256115,"owners_count":20909240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T19:02:18.812Z","updated_at":"2025-04-04T22:08:42.178Z","avatar_url":"https://github.com/interactivethings.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","Projects","Geodaten \u0026 Karten"],"sub_categories":["Maps","Daten \u0026 Grenzen"],"readme":"[![swiss-maps on npm](https://shields.io/npm/v/swiss-maps)](https://www.npmjs.com/package/swiss-maps)\n\n\u003e This is the documentation for the swiss-maps npm package and website v4.\n\u003e For the previous Makefile and instructions, please check the [legacy branch](https://github.com/interactivethings/swiss-maps/tree/legacy).\n\n# Swiss Maps\n\nThis repository provides a mechanism to generate [TopoJSON](https://github.com/mbostock/topojson) from publicly available [swisstopo](https://www.swisstopo.admin.ch/) geodata.\n\nThe geodata is based on the generalized from the [FSO](https://www.bfs.admin.ch/bfs/en/home/services/geostat/swiss-federal-statistics-geodata/administrative-boundaries/generalized-boundaries-local-regional-authorities.html).\n\nThe `Makefile` cleans the source data further, so the features are as consistent as possible across different years and the properties are consistently named.\n\nFor convenience, the generated files are published on [npm](https://www.npmjs.com/package/swiss-maps)\n\n## Getting Started\n\nAll Shapefiles and TopoJSON files are cleaned and pre-packaged in this package.\n\nYou can install it locally using npm:\n\n```sh\nnpm i swiss-maps\n```\n\nYou can read the files from the installed package directory, which is structured like this:\n\n```\n- node_modules/\n  - swiss-maps/\n    - 2010/\n      - cantons.{dbf,prj,shp,shx}\n      - country.{dbf,prj,shp,shx}\n      - districts.{dbf,prj,shp,shx}\n      - lakes.{dbf,prj,shp,shx}\n      - municipalities.{dbf,prj,shp,shx}\n      - ch-combined.json (TopoJSON)\n    - 2011/\n      ...\n    - 2021/\n```\n\nThe TopoJSON file combines all layers into one file. Separate TopoJSON files for single layers will be added in the future.\n\n## Use the TopoJson files in your web application\n\n### Load from Unpkg.com\n\nIf you don't want to install anything and just want to load the file, you can `fetch` it from https://unpkg.com (or any other npm registry CDN).\n\n```js\nimport * as topojson from \"topojson-client\";\n\nconst res = await fetch(`https://unpkg.com/swiss-maps@4/2021/ch-combined.json`);\nconst topo = await res.json();\n\nconst municipalities = topojson.feature(topo, topo.objects.municipalities);\n// Render the municipalities ...\n```\n\n### Bundled app (e.g. Next.js)\n\nIf you're using a bundler that can resolve locally installed npm packages, you can add the `swiss-maps` npm package to your project.\n\n```sh\nnpm i swiss-maps\n```\n\n```js\nimport * as topojson from \"topojson-client\";\n\nconst topo = await import(`swiss-maps/2021/ch-combined.json`);\n\nconst municipalities = topojson.feature(topo, topo.objects.municipalities);\n\n// Render the municipalities ...\n```\n\n## License\n\nThe code in this repository is licensed under BSD-3-Clause.\n\nThe geodata is published under a non-commercial license and needs to be attributed with the source \"Bundesamt für Statistik (BFS), GEOSTAT\".\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finteractivethings%2Fswiss-maps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finteractivethings%2Fswiss-maps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finteractivethings%2Fswiss-maps/lists"}