From 842b790c744cb85135eda1c70a443d09842b30ba Mon Sep 17 00:00:00 2001 From: Lukas Winkler Date: Sun, 7 Aug 2022 21:55:50 +0200 Subject: [PATCH] some more --- commands/stats.ts | 18 ++++++++ data/data.json | 113 +++++++++++++++++++++++++++++++++++++++++++++- missing.md | 6 +++ package.json | 1 + src/main.ts | 3 +- 5 files changed, 138 insertions(+), 3 deletions(-) create mode 100644 commands/stats.ts create mode 100644 missing.md diff --git a/commands/stats.ts b/commands/stats.ts new file mode 100644 index 0000000..c0f1e84 --- /dev/null +++ b/commands/stats.ts @@ -0,0 +1,18 @@ +import * as fs from "fs"; +import type {Crossing} from "../interfaces"; + +function runstats() { + const data: Crossing[] = JSON.parse(fs.readFileSync("../data/data.json", 'utf8')); + + + const bezirke = data.map(c => c.bezirk) + const counts: { [key: number]: number } = {}; + + for (const num of bezirke) { + counts[num] = counts[num] ? counts[num] + 1 : 1; + } + console.log(counts) + +} + +runstats() diff --git a/data/data.json b/data/data.json index 622dffc..5c839a6 100644 --- a/data/data.json +++ b/data/data.json @@ -36,8 +36,15 @@ { "id": 2, "name": "Spitalgasse/Lazarettgasse", - "bezirk": 5, + "bezirk": 9, "type": "transFlag", + "sources": [ + { + "type": "news", + "url": "https://www.meinbezirk.at/alsergrund/c-lokales/erster-trans-pride-zebrastreifen-in-wien_a4559450", + "date": "2021-03-31" + } + ], "geosource": { "type": "OSMnodes", "nodes": [ @@ -464,5 +471,107 @@ ], "length": 13.05 } + }, + { + "id": 14, + "name": "Simmeringer Platz", + "bezirk": 11, + "type": "prideFlag", + "sources": [ + { + "type": "news", + "url": "https://www.ggg.at/2021/06/11/erster-regenbogen-zebrastreifen-in-wien-simmering/", + "date": "2021-06-11" + } + ], + "geosource": { + "type": "OSMnodes", + "nodes": [ + 3635936885, + 1187573973, + 3635936886 + ] + }, + "geo": { + "coords": [ + [ + 16.4204776, + 48.1699476 + ], + [ + 16.4207196, + 48.1697158 + ] + ], + "length": 31.41 + } + }, + { + "id": 15, + "name": "Mauer Hauptplatz", + "bezirk": 23, + "type": "prideFlag", + "sources": [ + { + "type": "news", + "url": "https://www.meinbezirk.at/liesing/c-lokales/der-erste-regenbogenschutzweg-im-23-bezirk-wurde-eingeweiht_a4867192#gallery=null", + "date": "2021-09-07" + } + ], + "geosource": { + "type": "OSMnodes", + "nodes": [ + 4813210229, + 3324119404, + 4813210228 + ] + }, + "geo": { + "coords": [ + [ + 16.2687464, + 48.1507156 + ], + [ + 16.2686484, + 48.1505228 + ] + ], + "length": 22.64 + } + }, + { + "id": 16, + "name": "Elterleinplatz/Kalvarienberggasse", + "bezirk": 17, + "type": "prideFlag", + "sources": [ + { + "type": "official", + "url": "https://www.wien.gv.at/bezirke/hernals/politik/regenbogen-schutzweg.html", + "date": "2021-05-05" + } + ], + "geosource": { + "type": "OSMnodes", + "nodes": [ + 2888584160, + 2560176397, + 2560176389 + ] + }, + "geo": { + "coords": [ + [ + 16.3323528, + 48.2182154 + ], + [ + 16.3324665, + 48.2181988 + ] + ], + "length": 8.62 + } } -] +] \ No newline at end of file diff --git a/missing.md b/missing.md new file mode 100644 index 0000000..d410937 --- /dev/null +++ b/missing.md @@ -0,0 +1,6 @@ +https://www.ggg.at/2020/07/31/am-guertel-gibt-es-jetzt-den-laengsten-regenbogen-zebrastreifen/ +Gürtel/Felberstraße (7x) + +Josefstädter Straße/Albertgasse (1+2) +https://www.ggg.at/2021/04/23/neue-regenbogen-zebrastreifen-in-der-josefstadt-und-in-floridsdorf/ +Floridsdorfer Spitz (3x) diff --git a/package.json b/package.json index 8212832..ac38cad 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "", "scripts": { "fetch": "cd commands && ts-node fetch.ts", + "stats": "cd commands && ts-node stats.ts", "dev": "vite", "build": "tsc --skipLibCheck && vite build", "preview": "vite preview", diff --git a/src/main.ts b/src/main.ts index d1c7637..02aa529 100644 --- a/src/main.ts +++ b/src/main.ts @@ -46,7 +46,8 @@ const map = new Map({ view: new View({ center: fromLonLat([16.3787, 48.2089]), zoom: 13, - extent: transformExtent([16.2988, 48.1353, 16.4986, 48.2974], 'EPSG:4326', 'EPSG:3857'), + // https://www.wien.gv.at/statistik/lebensraum/tabellen/stadtgebiet-eckdaten.html + extent: transformExtent([16.18278, 48.11833, 16.58, 48.32306], 'EPSG:4326', 'EPSG:3857'), constrainOnlyCenter: true }) });