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.
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.
- geobas_logo.png
- legend.jpeg
- licence.png
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.
-GeoServer Installation
-
Documentation for Linux:
GeoServer Documentation -
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 -
Create geoserver folder in /usr/share/ directory:
sudo mkdir /usr/share/geoserverIf you do not have access /usr/share/ folder, use this command to access root shell:
sudo -i -
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 -
Add an environment variable to save the location of GeoServer by typing the following command:
echo "export GEOSERVER_HOME=/usr/share/geoserver" >> ~/.profile
. ~/.profile -
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/ -
Go to the /usr/share directory
cd /usr/shareIf you don't have the necessary permissions to access this directory, you may need to use sudo:
sudo cd /usr/share -
Start GeoServer by changing into the directory geoserver/bin and executing the startup.sh script:
cd geoserver/binsh startup.sh -
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
-
Download Plug-in:
geoserver-2.24-SNAPSHOT-ogcapi-features-plugin.zip
or download from terminal
wgethttps://build.geoserver.org/geoserver/2.24.x/community-latest/geoserver-2.24-SNAPSHOT-ogcapi-features-plugin.zip -
Move the zip file into
/usr/share/geoserver/webapps/geoserver/WEB-INF/liband 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 -
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/
-
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 startAfter running this code, it will show the localhost URL to open the map in browser.
-
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
Bundesamt für Strahlenschutz for use of their Geoportal
- Monitors radiation in Germany
- Provides public geoportal with hourly updated data