ogc-capabilities-generator

module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2025 License: MIT

README

ogc-capabilities-generator

Build Lint Go Report Card GitHub license Docker Pulls

What will it do

This application will give the user/developer 'full' control in the generation of a GetCapabilities document, instead of letting it be dictated by a specific application implementation. By configuring the input YAML files, one can enable/disable certain operations, constraints or filters in the advertised OGC GetCapabilities response document. This generated file can then be used in a static http server like Apache/NGINX/Lighttpd/and so on. This solution make it also flexible to deploy a OGC in a 'micro service' like environment such as K8s.

How to run

Building the binary

go build .

When the binary is built the application can be run with parsing the configuration in two ways:

  1. parsing the configuration through -c {path/to/config.yaml}
  2. setting the ENV var SERVICECONFIG={path/to/config.yaml}
XML_CATALOG_FILES=./xml-catalog/ogc-catalog.xml ./ogc-capabilities-generator -c ./examples/config/wmts_1_0_0.yaml

In dev mode through go run:

XML_CATALOG_FILES=./xml-catalog/ogc-catalog.xml go run . -c ./examples/config/wms_1_3_0.yaml
XML_CATALOG_FILES=./xml-catalog/ogc-catalog.xml go run . -c ./examples/config/wfs_2_0_0.yaml
XML_CATALOG_FILES=./xml-catalog/ogc-catalog.xml go run . -c ./examples/config/wmts_1_0_0.yaml

How to configure

The ogc-capabilities-generator makes usage of the ogc-specifications package

Test

XML_CATALOG_FILES=./xml-catalog/ogc-catalog.xml go test ./... -covermode=atomic -v

Docker

docker build -t pdok/ogc-capabilities-generator .

docker run --rm -d -v `pwd`/examples/config:/config -v `pwd`:/output \
-e SERVICECONFIG=/config/wfs_2_0_0.yaml --name ogc pdok/ogc-capabilities-generator

XML catalog

Install

You should have libxml2-utils installed:

apt-get install libxml2-dev libxml2-utils
Build

Download the relevant xsd schemas and its children into the xml-catalog/schemas directory (this tool does the job).

Add a line to the build-catalog.sh script for each downloaded schema url and its relative file location. Execute it:

./build-catalog.sh
Usage

Now you can use the command with the catalog:

XML_CATALOG_FILES=./xml-catalog/ogc-catalog.xml ./ogc-capabilities-generator -c ./examples/config/wmts_1_0_0.yaml

Directories

Path Synopsis
internal
ows
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL