Archived
1
0
Fork 0
This repository has been archived on 2024-06-28. You can view files and clone it, but cannot push or open issues or pull requests.
covidmap/convert.js
2020-03-22 22:39:12 +01:00

21 lines
639 B
JavaScript

const fs = require("fs");
const path = require("path");
const topojson = require("topojson");
const contents = fs.readFileSync("STATISTIK_AUSTRIA_POLBEZ_20200101Polygon.json");
const geojson = JSON.parse(contents);
delete geojson.totalFeatures;
delete geojson.crs;
geojson.meta = {};
geojson.features.forEach((feature) => {
});
result = topojson.topology({districts: geojson}, 1e5);
result = topojson.presimplify(result);
// result = topojson.simplify(result, 1e-9);
// result = topojson.quantize(result, 1e4);
result = topojson.filter(result, topojson.filterWeight);
fs.writeFileSync("public/map.topo.json", JSON.stringify(result));