• Vue 56.6%
  • TypeScript 32.4%
  • JavaScript 8.4%
  • CSS 2.1%
  • Dockerfile 0.3%
  • Other 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-20 11:03:52 +02:00
.github/workflows Bump github actions to v7 2026-08-08 09:43:16 +02:00
.vscode [CFG] config 2026-08-06 17:17:52 +02:00
assets/css Refactor for nuxt 4 2026-07-31 14:36:52 +02:00
components Upgrade tailwind to v4 2026-07-31 11:37:46 +02:00
composables Upgrades, improvements and fixes 2025-02-25 17:22:48 +01:00
config Restrict coordinate search to the canton boundary 2026-08-14 16:32:54 +02:00
helpers Restrict coordinate search to the canton boundary 2026-08-14 16:32:54 +02:00
i18n Refactor for nuxt 4 2026-07-31 14:36:52 +02:00
layouts Stop setupModule from overwriting source files 2026-07-31 16:11:41 +02:00
modules Stop setupModule from overwriting source files 2026-07-31 16:11:41 +02:00
pages Refactor for nuxt 4 2026-07-31 14:36:52 +02:00
plugins Refactor for nuxt 4 2026-07-31 14:36:52 +02:00
public Upgrade to Nuxt3, pinia and composition API 2024-10-05 16:29:15 +02:00
schemas/oereb-webservice new version 2022 2022-06-27 18:53:40 +02:00
scripts Restrict coordinate search to the canton boundary 2026-08-14 16:32:54 +02:00
services Fix esri token fetching 2026-07-31 14:06:47 +02:00
store Restrict coordinate search to the canton boundary 2026-08-14 16:32:54 +02:00
tests Restrict coordinate search to the canton boundary 2026-08-14 16:32:54 +02:00
types new version 2022 2022-06-27 18:53:40 +02:00
.dockerignore new version 2022 2022-06-27 18:53:40 +02:00
.editorconfig new version 2022 2022-06-27 18:53:40 +02:00
.env.example new version 2022 2022-06-27 18:53:40 +02:00
.gitignore Expand tests and add ci 2026-07-31 15:20:17 +02:00
.nvmrc Fix ci install and use node 24 2026-07-31 16:00:11 +02:00
Dockerfile Fix ci install and use node 24 2026-07-31 16:00:11 +02:00
eslint.config.ts Change logic preventing rapid zoom outs on changing focus 2024-11-21 21:29:28 +01:00
LICENSE.md Add LICENSE 2022-08-02 15:51:16 +02:00
nuxt.config.ts Refactor for nuxt 4 2026-07-31 14:36:52 +02:00
package-lock.json Drop deprecated nested vue-i18n copy 2026-08-08 09:48:32 +02:00
package.json Drop deprecated nested vue-i18n copy 2026-08-08 09:48:32 +02:00
playwright.config.ts Expand tests and add ci 2026-07-31 15:20:17 +02:00
publiccode.yml Add publicode.yml (purpose: opensource.admin.ch) 2026-06-25 09:42:16 +02:00
README.md Restrict coordinate search to the canton boundary 2026-08-14 16:32:54 +02:00
tsconfig.json Upgrade to Nuxt3, pinia and composition API 2024-10-05 16:29:15 +02:00
vitest.config.ts Expand tests and add ci 2026-07-31 15:20:17 +02:00

OEREB-Viewer

Source code to setup a viewer for the Cadastre of Public-law Restrictions on landownership (DE: ÖREB-Kataster) displaying the JSON-Extract of the PLR-cadastre.

Setup

Configuration

Before building the OEREB-Viewer, copy .env.example into .env and edit the configuration.

Replace local with your directory name under ./config. For example, use bern instead.

# apply configurations from this directory in ./config
NUXT_ENV_CONFIG_CONTEXT=local

# credentials for esri token authentication
NUXT_ENV_TOKEN_USERNAME=user
NUXT_ENV_TOKEN_PASSWORD=password

See Custom Configuration for configuration instructions.

Platform

If you don't use Docker, the Node runtime version 20.19 or newer (22 recommended, see .nvmrc) is required for the build step. Check out Node for more information.

Use with Docker

For simple deployment with Docker, a Dockerfile is provided. During the build, a static build of the app is generated and bundled with an HTTP server.

Build Docker image

Change the directory to where the OEREB-Viewer code is placed and run the build command. This command tags the image with oereb-viewer

docker build -t oereb-viewer .

Run Docker image

The oereb-viewer image exposes the port 3000.

Make sure your final port is linked to the exposed port of the image

# link local port 3000 to exposed port 3000
docker run -it -p 3000:3000 oereb-viewer

Use without Docker

For detailed explanation on how things work, check out the Nuxt docs.

Based on static files

Static files are generated in the ./dist directory. A web server is required to serve the static files.

# install dependencies
npm install

# build to be served statically from ./dist
npm run generate

# serve ./dist locally
npm run start

Build for development and testing purpose

# install dependencies
npm install

# build for development via localhost:3000
npm run dev

# run unit tests / coverage report
npm run test
npm run test:coverage

# lint
npm run lint

Custom Configuration

Configuration are stored under ./config and can be selected by setting NUXT_ENV_CONFIG_CONTEXT in the .env file.

# change the title shown in the browser tab
NUXT_ENV_TITLE="ÖREB-Viewer | Visualiseur RDPPF"

# define wich configuration should be applied
NUXT_ENV_CONFIG_CONTEXT=bern

# if your viewer reqires
NUXT_ENV_TOKEN_USERNAME=user
NUXT_ENV_TOKEN_PASSWORD=password

Custom configurations are merged with the default configurations by merging and overwriting same configurations.

When starting a new custom configuration, consider copying an existing configuration into a new directory, updating .env and updating each configuration carefully.

Place local configurations in ./config/local or ./config/<any-name>-local like ./config/bern-local. They won't be tracked by git, as they are in .gitignore.

setup.js

This is where you place your settings.

setup.css

Create a setup.css file in your config directory, if you want to overwrite theme colors or any css.

/** overwrite theme css variables with your own RGB colors */
:root {
    --color-background-primary: 45, 54, 62;
    --color-text-primary: 255, 255, 255;

    --color-background-secondary: 203, 211, 219;
    --color-text-secondary: 45, 54, 62;

    --color-background-accent: 255, 255, 255;
    --color-text-accent: 203, 0, 14;

    --color-text-decent: 94, 114, 135;

    --color-background-base: 254, 254, 254;
    --color-text-base: 45, 54, 62;

    --color-background-active: 94, 114, 135;
    --color-text-active: 255, 255, 255;

    --color-border-primary: 94, 114, 135;
    --color-border-secondary: 187, 187, 187;

    --color-background-thirdly: 228, 233, 237;
}

/** place your custom css here */

boundary.json

Optional canton boundary limiting coordinate lookups in the search. Coordinates outside the boundary are shown as a disabled search result. Without this file there is no restriction.

Generate it from the official swissBOUNDARIES3D dataset, where the feature id is the official canton number:

node scripts/generate-boundary.mjs <cantonNumber> config/{customdir}/boundary.json
 1 Zürich       8 Glarus            15 Appenzell Ausserrhoden  22 Vaud
 2 Bern         9 Zug               16 Appenzell Innerrhoden   23 Valais
 3 Luzern      10 Fribourg          17 St. Gallen              24 Neuchâtel
 4 Uri         11 Solothurn         18 Graubünden              25 Genève
 5 Schwyz      12 Basel-Stadt       19 Aargau                  26 Jura
 6 Obwalden    13 Basel-Landschaft  20 Thurgau
 7 Nidwalden   14 Schaffhausen      21 Ticino

Reference it in your setup.js:

import boundary from './boundary.json'

export const coordinateBoundary = boundary

The geometry is simplified to 250m (to save bandwidth) and the viewer accepts points up to 1km outside of it, so the boundary is intentionally not an exact border - the ÖREB service remains the authority near the border.

Both distances can be tuned: the acceptance margin is BOUNDARY_GRACE_DISTANCE in helpers/coordinates.ts, the simplification tolerance is TOLERANCE in scripts/generate-boundary.mjs (regenerate the boundary files after changing it). Keep the margin at least as large as the tolerance, otherwise simplification may reject valid border parcels.

locales

Add custom translations as JSON-files, for example ./config/{customdir}/locales/de.json.

Overwrite languages by adding locales to your setup.js

export const locales = [
  { code: 'de', language: 'de-CH', file: 'de.js', title: 'Deutsch' },
  { code: 'fr', language: 'fr-CH', file: 'fr.js', title: 'Français' },
  { code: 'rm', language: 'rm-CH', file: 'rm.js', title: 'Rumantsch' },
  { code: 'en', language: 'en-CH', file: 'en.js', title: 'English' },
]

A JavaScript language file is required, to add merge capabilities with default locales

Built With

Maintainer of This Repo

Owner is the Canton of Berne. Admins of the repo are: