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.
Building the binary
go build .
When the binary is built the application can be run with parsing the configuration in two ways:
- parsing the configuration through -c {path/to/config.yaml}
- 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
The ogc-capabilities-generator makes usage of the ogc-specifications package
XML_CATALOG_FILES=./xml-catalog/ogc-catalog.xml go test ./... -covermode=atomic -v
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
You should have libxml2-utils installed:
apt-get install libxml2-dev libxml2-utils
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
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