-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
289 lines (261 loc) · 15.1 KB
/
index.html
File metadata and controls
289 lines (261 loc) · 15.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Gebäudevolumen — Volumen- und Flächenschätzung</title>
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;500;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0" rel="stylesheet">
<!-- MapLibre GL JS -->
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@4.7.1/dist/maplibre-gl.css" crossorigin="anonymous" />
<script src="https://unpkg.com/maplibre-gl@4.7.1/dist/maplibre-gl.js" crossorigin="anonymous"></script>
<!-- GeoTIFF.js (COG reading) -->
<script src="https://cdn.jsdelivr.net/npm/geotiff@2.1.3/dist-browser/geotiff.js" crossorigin="anonymous"></script>
<!-- proj4 (coordinate transforms) -->
<script src="https://cdn.jsdelivr.net/npm/proj4@2.12.1/dist/proj4.js" crossorigin="anonymous"></script>
<!-- Turf.js (spatial operations) -->
<script src="https://unpkg.com/@turf/turf@7/turf.min.js" crossorigin="anonymous"></script>
<!-- App CSS -->
<link rel="stylesheet" href="webapp/css/tokens.css">
<link rel="stylesheet" href="webapp/css/styles.css">
</head>
<body>
<noscript>
<div style="padding:2rem;text-align:center;font-family:system-ui,sans-serif">
<h1>JavaScript erforderlich</h1>
<p>Diese Anwendung benotigt JavaScript. Bitte aktivieren Sie JavaScript in Ihren Browser-Einstellungen.</p>
</div>
</noscript>
<div class="app">
<!-- Header -->
<header id="header">
<div class="header-left">
<img src="assets/swiss-logo-flag.svg" alt="" class="header-flag" width="20" height="22">
<div class="header-title">
<span class="header-agency">Bundesamt fur Bauten und Logistik</span>
<span class="header-app">Gebäudevolumen</span>
</div>
</div>
<!-- Search bar (center) -->
<div id="search-wrapper" class="search-wrapper" hidden>
<div class="search-container">
<span class="material-symbols-outlined search-icon" aria-hidden="true">search</span>
<input type="text" id="search-input" placeholder="Suche nach Gebäuden oder Orten" autocomplete="off" aria-label="Suche">
<button id="search-clear-btn" class="search-clear" hidden aria-label="Suche loschen">×</button>
</div>
<div id="search-results" class="search-results" role="listbox" aria-label="Suchergebnisse" hidden></div>
</div>
<div class="header-right">
<button id="btn-new" class="btn btn-secondary" hidden>Neue Analyse</button>
<button id="btn-download" class="btn btn-primary" hidden>
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
<span>Herunterladen</span>
</button>
</div>
</header>
<!-- Main -->
<main id="main-content">
<!-- STATE 1: Upload -->
<section id="state-upload" class="app-state" aria-label="Datei hochladen">
<div class="upload-container">
<div class="upload-card">
<div class="intro">
<h1 class="intro-title">Gebäudevolumen und Geschossflächen schätzen</h1>
<p class="intro-desc">
Laden Sie eine CSV-Datei mit Gebäude-Koordinaten (lon/lat) oder EGID hoch.
Die App berechnet automatisch Volumen, Höhen und Geschossflächen
aus swisstopo-Höhenmodellen und dem Gebäude- und Wohnungsregister (GWR).
</p>
</div>
<div class="steps" role="list">
<div class="step" role="listitem">
<div class="step-number">1</div>
<div class="step-label"><span>Hochladen</span><br><span>CSV / XLSX</span></div>
</div>
<div class="step-arrow" aria-hidden="true">▶</div>
<div class="step" role="listitem">
<div class="step-number">2</div>
<div class="step-label"><span>Berechnen</span><br><span>Volumen + Flächen</span></div>
</div>
<div class="step-arrow" aria-hidden="true">▶</div>
<div class="step" role="listitem">
<div class="step-number">3</div>
<div class="step-label"><span>Exportieren</span><br><span>CSV / Excel</span></div>
</div>
</div>
<div id="drop-zone" class="drop-zone" role="button" tabindex="0" aria-label="Datei hier ablegen oder klicken">
<div class="drop-zone-icon" aria-hidden="true">
<svg width="56" height="56" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" y1="3" x2="12" y2="15"/></svg>
</div>
<h2>CSV- oder Excel-Datei hierher ziehen</h2>
<p>oder klicken zum Durchsuchen</p>
<p class="drop-zone-hint">Erforderlich: id, lon, lat (oder id, egid) · Max. 5'000 Zeilen</p>
</div>
<input type="file" id="file-input" accept=".csv,.xlsx,.xls,.tsv,.txt" hidden aria-label="Datei auswahlen">
<p class="demo-link"><a href="data/example.csv" download="vorlage-gebaeude.csv">Vorlage herunterladen (CSV)</a></p>
<p class="demo-link"><span>Oder testen Sie mit </span><a href="#" id="load-demo">Beispieldaten</a></p>
<div id="upload-error" class="upload-error" role="alert" hidden></div>
<div class="privacy-note">
<svg class="privacy-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>
<span>Ihre Daten bleiben im Browser. Nur Koordinaten und EGID
werden an die swisstopo-API gesendet. Höhenmodelle werden direkt von data.geo.admin.ch geladen.</span>
</div>
</div>
</div>
</section>
<!-- STATE 2: Processing -->
<section id="state-processing" class="app-state" aria-label="Verarbeitung" hidden>
<div class="processing-container">
<div class="processing-card">
<h2>Gebäude werden analysiert...</h2>
<div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" aria-label="Fortschritt">
<div id="progress-bar-fill" class="progress-bar-fill"></div>
</div>
<div id="progress-text" aria-live="polite">Datei wird verarbeitet...</div>
<div id="progress-eta"></div>
<div id="progress-stats"></div>
<button id="btn-cancel" class="btn btn-secondary">Abbrechen</button>
</div>
</div>
</section>
<!-- STATE 3: Results -->
<section id="state-results" class="app-state" aria-label="Ergebnisse" hidden>
<div class="results-container">
<!-- Main: map + table -->
<div class="results-main">
<div id="map-panel" class="map-panel">
<div id="results-map"></div>
<!-- Accordion tools menu -->
<div id="accordion-wrapper">
<aside id="accordion-panel" aria-label="Kartenwerkzeuge">
<div class="accordion-item" id="active-layers-accordion">
<button class="accordion-header active" aria-expanded="true">
<span class="accordion-arrow" aria-hidden="true"><span class="material-symbols-outlined">chevron_right</span></span>
<span>Dargestellte Karten</span>
</button>
<div class="accordion-content show">
<div class="layer-group">
<div class="layer-group-label">Analyseergebnisse</div>
<label class="active-layer-item">
<input type="checkbox" class="active-layer-checkbox" checked id="layer-toggle-footprints">
<span class="active-layer-title">Gebäudegrundflächen</span>
</label>
<label class="active-layer-item">
<input type="checkbox" class="active-layer-checkbox" checked id="layer-toggle-buildings">
<span class="active-layer-title">Gebäudevolumen</span>
</label>
<label class="active-layer-item">
<input type="checkbox" class="active-layer-checkbox" id="layer-toggle-grid">
<span class="active-layer-title">Rasterzellen</span>
</label>
<label class="active-layer-item">
<input type="checkbox" class="active-layer-checkbox" id="layer-toggle-storeys">
<span class="active-layer-title">Geschosspolygone</span>
</label>
<label class="active-layer-item">
<input type="checkbox" class="active-layer-checkbox" checked id="layer-toggle-labels">
<span class="active-layer-title">Beschriftungen</span>
</label>
<label class="active-layer-item">
<input type="checkbox" class="active-layer-checkbox" checked id="layer-toggle-clusters">
<span class="active-layer-title">Clustering</span>
</label>
</div>
<div class="layer-group">
<div class="layer-group-label">Externe Karten</div>
<label class="active-layer-item">
<input type="checkbox" class="active-layer-checkbox" id="layer-toggle-av" data-swisstopo="ch.kantone.cadastralwebmap-farbe">
<span class="active-layer-title">Amtliche Vermessung</span>
</label>
</div>
</div>
</div>
</aside>
<button id="menu-toggle" type="button">
<span class="material-symbols-outlined">expand_less</span>
<span id="menu-toggle-text">Menu schliessen</span>
</button>
</div>
<!-- Basemap selector -->
<div class="style-switcher" id="style-switcher">
<div class="style-switcher-panel" id="style-panel">
<button class="style-option active" data-style="positron" title="Hell">
<img src="https://basemaps.cartocdn.com/light_all/8/134/91.png" alt="Hell" loading="lazy">
<span>Hell</span>
</button>
<button class="style-option" data-style="voyager" title="Standard">
<img src="https://basemaps.cartocdn.com/rastertiles/voyager/8/134/91.png" alt="Standard" loading="lazy">
<span>Standard</span>
</button>
<button class="style-option" data-style="swissimage" title="Luftbild">
<img src="https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.swissimage/default/current/3857/8/134/91.jpeg" alt="Luftbild" loading="lazy">
<span>Luftbild</span>
</button>
<button class="style-option" data-style="dark-matter" title="Dunkel">
<img src="https://basemaps.cartocdn.com/dark_all/8/134/91.png" alt="Dunkel" loading="lazy">
<span>Dunkel</span>
</button>
</div>
<button class="style-switcher-btn" id="style-switcher-btn" title="Hintergrund wechseln">
<img id="current-style-thumb" src="https://basemaps.cartocdn.com/light_all/8/134/91.png" alt="Kartenstil" loading="lazy">
<span>Hintergrund</span>
</button>
</div>
<!-- Table toggle button -->
<button id="tbl-toggle" class="tbl-toggle" title="Tabelle ein-/ausblenden" aria-label="Tabelle ein-/ausblenden">
<span class="material-symbols-outlined" aria-hidden="true">expand_more</span>
<span class="tbl-toggle-label">Tabelle</span>
</button>
</div>
<div class="table-panel" id="results-table-container"></div>
</div>
<!-- Right summary panel -->
<aside id="summary-panel" class="summary-panel" aria-label="Zusammenfassung">
<div class="sp-header">
<h3>Zusammenfassung</h3>
<button id="sp-close" class="close-btn" aria-label="Schliessen">×</button>
</div>
<div class="sp-body" id="sp-body"></div>
</aside>
</div>
</section>
</main>
<!-- Download modal -->
<div id="download-overlay" class="dl-overlay" role="dialog" aria-modal="true" aria-label="Ergebnisse herunterladen" hidden>
<div class="dl-modal">
<div class="dl-header">
<h3>Ergebnisse herunterladen</h3>
<button id="dl-close" class="close-btn close-btn--lg" aria-label="Dialog schliessen">×</button>
</div>
<div class="dl-body">
<button class="dl-option" id="dl-csv">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>
<div class="dl-option-text"><strong>Ergebnisse CSV</strong><span>Volumen, Höhen und Geschossflächen pro Gebäude</span></div>
</button>
<button class="dl-option" id="dl-xlsx">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>
<div class="dl-option-text"><strong>Excel (.xlsx)</strong><span>Alle Ergebnisse in einem Workbook</span></div>
</button>
<button class="dl-option" id="dl-geojson">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg>
<div class="dl-option-text"><strong>GeoJSON</strong><span>Gebäude-Polygone mit Attributen</span></div>
</button>
</div>
</div>
</div>
<!-- Footer -->
<footer id="footer">
<div class="footer-info"><span id="footer-coords">—</span></div>
<div class="footer-links">
<a href="https://github.com/bbl-dres/area-estimator" target="_blank" rel="noopener">Quellcode</a>
<a href="https://www.admin.ch/gov/de/start/rechtliches.html" target="_blank" rel="noopener">Rechtliches</a>
</div>
</footer>
</div>
<!-- App JS (ES modules) -->
<script type="module" src="webapp/js/main.js"></script>
</body>
</html>