Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Repository files navigation

Geobase

Exploring OGC (Open Geospatial Consortium) API with Geoserver and OpenLayers (based on BfS (the German Bundesamt fuer Strahlenschutz) radiological OGC services).

A web application for displaying geographic data using the new OGC API Standards, Geoserver, and OpenLayers.

Overview

The accomplished project represents the results of the work within the Open Source GIS course during the Winter 2023-2024 semester as part of the Geomatics MSc, run by the Karlsruhe University of Applied Sciences has published on GitHUB.

The project as a whole aimed to explore the new features and possibilities offered by the new OGC API framework, a new standard based on OpenAPI which is succeeding the new OGS API standard.

Example data was obtained from an OWS service of Radiological Data hosted by the German Bundesamt fuer Strahlenschutz (BfS). The project was built on the existing project done by GoSolutions last Winter Semester 2022-2023.

Project Files

  • index.html
  • style.css
  • main.js
  • package-lock.json
  • package.json
  • about_the_project.html
  • orginal_data_source.html
  • ogc_api_documentation.html
  • license_page.html
  • github_repository.html
  • media
    • geobas_logo.png
    • legend.jpeg
    • licence.png
  • vite.config.js
  • Installation

    To run and make changes in the project (development mode), please follow installation instructions below as necessary. If it is required only to run the project (production mode), then Node.js and npm codes are not needed.

    Requirements

  • Java
  • Geoserver
  • OGC API Plug-in
  • Node.js
  • Back-end

    -GeoServer Installation

    1. Documentation for Linux:
      GeoServer Documentation

    2. Download binary file:
      https://sourceforge.net/projects/geoserver/files/GeoServer/2.24.1/geoserver-2.24.1-bin.zip Download geoserver-2.24.1-bin.zip

    3. Create geoserver folder in /usr/share/ directory:
      sudo mkdir /usr/share/geoserver

      If you do not have access /usr/share/ folder, use this command to access root shell:
      sudo -i

    4. Go into geoserver path, move and extract geoserver-2.24.1-bin.zip file in that directory: cd /usr/share/geoserver
      mv /home/user/Downloads/geoserver-2.24.1-bin.zip /usr/share/geoserver
      unzip geoserver-2.24.1-bin.zip

    5. Add an environment variable to save the location of GeoServer by typing the following command: echo "export GEOSERVER_HOME=/usr/share/geoserver" >> ~/.profile
      . ~/.profile

    6. Make yourself the owner of the geoserver folder. Type the following command in the terminal window, replacing USER_NAME with your own username. example: sudo chown -R USER_NAME /usr/share/geoserver/
      sudo chown -R user /usr/share/geoserver/

    7. Go to the /usr/share directory
      cd /usr/share

      If you don't have the necessary permissions to access this directory, you may need to use sudo:
      sudo cd /usr/share

    8. Start GeoServer by changing into the directory geoserver/bin and executing the startup.sh script: cd geoserver/bin sh startup.sh

    9. Brower using browser:
      http://localhost:8080/geoserver/

    For starting again Geoserver, you can run the codes from 6 to 9 steps, again.

    -OGC API Plug-in in Geoserver

    1. Download Plug-in:
      geoserver-2.24-SNAPSHOT-ogcapi-features-plugin.zip
      or download from terminal
      wget https://build.geoserver.org/geoserver/2.24.x/community-latest/geoserver-2.24-SNAPSHOT-ogcapi-features-plugin.zip

    2. Move the zip file into /usr/share/geoserver/webapps/geoserver/WEB-INF/lib and extract it:
      mv /home/user/Downloads/geoserver-2.24-SNAPSHOT-ogcapi-features-plugin.zip /usr/share/geoserver/webapps/geoserver/WEB-INF/lib
      unzip geoserver-2.24-SNAPSHOT-ogcapi-features-plugin.zip

    3. Restart GeoServer to load the new plug-in by using this command:
      sudo service geoserver restart

    -Getting BfS Data into GeoServer

    BfS data is taken as a new vector data source by using Web Feature Server in GeoServer. The retrieval URL from Data Interface page of BfS Server is used. Then, requested layers are published.
    Data Interface Page of BfS Website

    -CORS Settings in GeoServer Configuration

    In GeoServer configuration, CORS settings are needed to allow sharing resources between localhost ports (Geoserver port number: 8080 and OpenLayers port number: 5173). web.xml file can be checked in this directory:
    /usr/share/geoserver/webapps/geoserver/WEB-INF/

    Front-end: OpenLayers + Vite

    1. To visualise the map in website, firstly go to the directory of project in terminal and run the following code (requires Node 14+):
      npm install
      npm start

      After running this code, it will show the localhost URL to open the map in browser.

    2. To generate a build ready for production:
      npm run build

    To be able to run the project on Firefox; after installing debugger in VS Code for Firefox, launch.json file in .vscode folder should be edited as: { "version": "0.2.0", "configurations": [ { "name": "Launch localhost", "type": "firefox", "request": "launch", "reAttach": true, "url": "http://localhost:5173", "pathMappings": [{ "url": "http://localhost:5173/", "path": "${workspaceFolder}/home/user/geobase-back" //Project folder }] } ] }

    -Visual Studio Code for Web Programming
    To create and make changes in codes, Visual Studio Code (VS Code) is used. It is free and built on open source.
    Download Visual Studio Code VSCode

    Authors

    Acknowledgements

    Bundesamt für Strahlenschutz for use of their Geoportal

    • Monitors radiation in Germany
    • Provides public geoportal with hourly updated data

    Attributions

  • Open Layers is licensed under BSD 2-Clause License
  • OGC API is licensed under Permission is hereby granted by the Open Geospatial Consortium, ("Licensor")
  • BfS ODL Data is licensed under Ordinance on the determination of the terms of use for the provision of federal geodata (GeoNutzV), Data License Germany - Attribution - Version 2.0.
  • Blue Marble Basemap is licensed under BSD 3-Clause (New) License
  • Git is licensed under GNU General Public License version 2.0
  • GitHub is licensed under MIT License
  • VS Code is licensed under MIT License
  • About

    Repo of fictional company Geobase course WS 2023/2024 (backend development)

    Resources

    Stars

    0 stars

    Watchers

    1 watching

    Forks

    Releases

    Packages

    Contributors

    Languages