Skip to content

bbl-dres/geo-check

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

210 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Geo-Check

Verify your building records against the official Gebäude- und Wohnungsregister (GWR) — identify mismatches, download enriched results, fix your source data, and re-upload to improve quality iteratively.

Geo-Check — Results view with map, summary panel, and data table

GitHub Pages JavaScript No Backend License: MIT Swiss Federal Admin MapLibre GWR API

Open Geo-Check: https://bbl-dres.github.io/geo-check/

Prototype with Project Management: https://bbl-dres.github.io/geo-check/prototype1


How It Works

graph LR
    A["Upload<br/>CSV / XLSX"] --> B["Enrich<br/>vs. GWR"]
    B --> C["Review<br/>Map + Table"]
    C --> D["Download<br/>enriched file"]
    D --> E["Fix source data"]
    E --> A
Loading
  1. Upload a CSV or Excel file with your building data (requires internal_id and egid columns)
  2. Enrich — each EGID is looked up against the public GWR API; address, coordinates, building type, and more are compared and scored (0–100)
  3. Review — explore results on an interactive map with color-coded markers and a sortable, filterable table
  4. Download — export enriched results as CSV, Excel, or GeoJSON
  5. Fix & repeat — correct mismatches in your source file and re-upload to verify improvements

Key Features

  • Interactive map — MapLibre GL with CARTO basemaps (Positron, Dark Matter, Voyager) and Swisstopo aerial imagery; location search via swisstopo SearchServer
  • Results table — sortable, filterable, paginated; confidence presets (High / Medium / Low); clickable badges to filter by match result; column visibility toggle
  • Match scoring — weighted comparison across street, house number, ZIP, city, canton, building type, and coordinates with confidence classification
  • GWR code resolution — integer codes (building category, class, status, heating, etc.) resolved to multilingual labels (DE / FR / IT)
  • Export formats — CSV (semicolon, UTF-8 BOM), Excel (results + summary sheets), GeoJSON
  • Multilingual — DE, FR, IT, EN interface

Privacy

All processing happens in the browser. No data is uploaded to any server.

  • No backend, no database, no cookies, no analytics
  • Only the EGID (a public building identifier) is sent to the GWR API
  • Nothing persists between sessions — close the tab and data is gone

Credits & Data Sources

Data

Source Usage API
GWR — Gebäude- und Wohnungsregister Building data (address, type, coordinates, heating, etc.) MapServer/find
swisstopo — Bundesamt für Landestopografie Location search for map navigation SearchServer
CARTO Basemap tiles (Positron, Dark Matter, Voyager) Free, no API key
OpenStreetMap Map data underlying CARTO tiles ODbL
Swisstopo WMTS Aerial imagery basemap Free, no API key

Both swisstopo APIs are public and require no API key.

Libraries

Library Purpose License
MapLibre GL JS Interactive vector map BSD-3-Clause
Papa Parse CSV parsing MIT
SheetJS Excel parsing & export Apache-2.0

All loaded via CDN — no build step, no node_modules.

File Structure

geo-check/
├── index.html              # Single-page application
├── css/
│   ├── tokens.css          # Design tokens (colors, spacing, typography)
│   └── styles.css          # Component styles
├── js/
│   ├── main.js             # App state machine (upload → processing → results)
│   ├── upload.js           # File parsing, column detection, mapping UI
│   ├── processor.js        # GWR API calls, batching, match scoring
│   ├── map.js              # MapLibre GL map, markers, popups
│   ├── table.js            # Results table, sorting, filtering, pagination
│   ├── export.js           # CSV, XLSX, GeoJSON generation
│   ├── gwr-codes.js        # Code → label resolution
│   └── utils.js            # String similarity, helpers
├── data/
│   └── gwr-codes.json      # GWR code tables (DE/FR/IT)
├── assets/
│   ├── demo-buildings.csv   # Sample data for testing
│   ├── GWR Codes.xlsx       # Source for gwr-codes.json
│   └── swiss-logo-flag.svg  # Branding
└── docs/
    └── SPECIFICATION.md     # Full specification

No node_modules, no package.json, no build step. All dependencies loaded via CDN.

Running Locally

Serve the project root with any static file server:

# Python
python -m http.server 8000

# Node.js (npx)
npx serve .

# VS Code
# Install "Live Server" extension, right-click index.html → Open with Live Server

Then open http://localhost:8000 in your browser.

Input Format

Upload a CSV or Excel file with these columns:

Column Required Example
internal_id Yes SAP-4821
egid Yes 1755615
street No Bahnhofstrasse
street_number No 12
zip No 8001
city No Zürich
region No ZH
building_type No 1020
latitude No 47.3769
longitude No 8.5417
country No CH
comment No Check roof area

Column headers are matched case-insensitively with common aliases (e.g., plzzip, hausnummerstreet_number). A sample file is available at assets/demo-buildings.csv.

License

MIT — developed by the Bundesamt für Bauten und Logistik (BBL) of the Swiss Federal Administration.