Table of Contents

GeoServer

Installation

  1. Install Java
    1. If you don’t have an installation e.g. from Elasticsearch, install the Java JDK version (>= 11) from https://java.com/en/download/manual.jsp or http://jdk.java.net/12/
  2. Add JAVA_HOME to your environment and set path to Java JDK directory.
  3. Download latest stable version from http://geoserver.org/download/
  4. unzip it to a directory, e.g. c:\Program Files\GeoServer.
  5. Select a data directory for GeoServer, e.g. D:\geoserver_data, it is not recommended to use the standard ‚data_dir‘ directory inside the GeoServer installation. You can copy the files from the data_dir to your data directory to have some demo layers, or start from an empty directory.
  6. Add environent variables
    1. GEOSERVER_DATA_DIR=D:\geoserver_data
    2. GEOSERVER_HOME=C:\Program Files\GeoServer

Start/Stop GeoServer

Start the server with:

%GEOSERVER_HOME%\bin\startup.bat

stopping with

%GEOSERVER_HOME%\bin\shutdown.bat

if it is running, you can access GeoServer on http://localhost:8080/geoserver/web/ login with default username ‘admin’, password ‘geoserver’

if you cannot access Geoserver check the error messages in the console window or logfile, usually an enviroment variable or Java installation is wrong.

GeoServer as windows service

In production environment it is recommended to use the Linux version of GeoServer. For windows there you can use the service wrapper to run Geoservice as a service.

Download wrapper: https://www.krenger.ch/blog/tag/java-service-wrapper/

Adding layers to GeoServer

Assuming you started from an empty data directory.

  1. Copy your data into a subdirectory in %GEOSERVER_DATA_DIR%\data
  2. create a workspace with a same WORKSPACENAME
  3. add new store with the data you copied in 1.
  4. add new layer with the store and some name LAYERNAME, set bouding box with ‘Compute from native bounds ‘
  5. add a style for the layer and publish, maybe you have to create a new style for lines/text
  6. view layer data in layer preview

Performance Hints for Layers

1. Handle non-WGS84 data sources

  1. Within the GeoServer, Go to “Layers”, Select the layer
  2. On the “Data” tab, scroll down to “Coordinate Reference Systems”
  3. If the “Native SRS” is not equal to “EPSG:4326”, set the “Declared SRS” to “EPSG:4326”
  4. Set “SRS handling” to “Reproject native to declared”

Show GeoServer layers in Terra

  1. Create new layer
  2. Layer Type Imaginary
  3. Set Layer class to match the usecase; e.g. select map for street information
  4. set Driver WMS
  5. set URL to http://admin:mypassword@localhost:8080/geoserver/WORKSPACENAME/wms (make sure to include the username and password in the URL)
  6. set Layername to WORKSPACENAME:LAYERNAME
  7. set WMS Version to “1.1.0”
  8. set Spatial reference system to the “declared SRS” as seen in the GeoServer layer configuration (section Coorindate Reference Systems); e.g. “EPSG:4326” for WGS84
  9. set Transparancy, probably to yes
  10. Press “Apply”
  11. In Configurator enable the layer in the GIS view (it may take a while until you see something); make sure the GIS view is within the layer bounding box

repeat above for each layer you want to see, if you show multiple layers always together, it is better to create a Layergroup in GeoServer and show this as a single layer in Terra. Using too many GeoServer layers in Terra will degrade performance significantly.

If you change layers in Geoserver you have to clear the Terra4D cache before you will see the changes in Terra – best test layer changes first in the GeoServer preview..

If you see an error “401” for the layer, the username and/or password is wrong. Make sure to properly encode any “special” characters in the URL.

Further hints

  1. Styles (SLD) files for OSM data
  2. http://www.gdal.org/drv_osm.html (GDAL OSM driver doc)
  3. If an attribute is referenced (used) by a style file (SLD) the GeoServer throws an exception with the information about the missing attribute. The exception is visible in the console of the GeoServer start batch.