2022-08-07 21:55:50 +02:00
|
|
|
import * as fs from "fs";
|
|
|
|
import type {Crossing} from "../interfaces";
|
|
|
|
|
|
|
|
function runstats() {
|
2022-08-15 15:54:18 +02:00
|
|
|
const data: Crossing[] = JSON.parse(fs.readFileSync("../data/Wien.json", 'utf8'));
|
2022-08-07 21:55:50 +02:00
|
|
|
|
2022-12-11 20:47:19 +01:00
|
|
|
console.log("total", data.length)
|
2022-08-07 21:55:50 +02:00
|
|
|
|
2022-08-15 15:54:18 +02:00
|
|
|
const bezirke = data.map(c => c.bezirk!)
|
2022-08-07 21:55:50 +02:00
|
|
|
const counts: { [key: number]: number } = {};
|
|
|
|
|
|
|
|
for (const num of bezirke) {
|
|
|
|
counts[num] = counts[num] ? counts[num] + 1 : 1;
|
|
|
|
}
|
|
|
|
console.log(counts)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
runstats()
|