Origo Config Layer Extractor
Summary
Extracts detailed layer information from an Origo-map configuration JSON file. This transformer is specifically designed to handle Origo's non-standard JSON format, which may include single-line (//) and multi-line (/* ... */) comments, before parsing the layer definitions.
GitHub
https://github.com/origo-map
Detailed Description
Origo map configurations are stored in JSON files that define groups, layers, sources, styles, and more. This transformer simplifies the process of reading these configurations by targeting the layer definitions directly.
A key feature of this transformer is its ability to parse JSON files containing comments. Standard JSON parsers will fail on files with // or /* ... */ comments, a common practice in Origo configurations. This transformer pre-processes the file to strip out comments, ensuring robust and error-free parsing.
It iterates through all layers defined in the configuration and outputs a separate feature for each one, with attributes containing key details like layer name, title, abstract, source URL, style, and a list of its attributes.
Input Ports
Port
Description
INPUT
Receives URL- or filepath to trigger the reading and processing of the Origo config file.
Output Ports
Port
Description
LAYER
Outputs one feature for each layer found in the configuration file. Each feature will have attributes containing the extracted layer details.
JSON
Outputs a single feature containing the original and the cleaned (comment-free) JSON content.
REJECTED
Outputs the original input feature if the specified JSON file cannot be found, is malformed (beyond comment handling).
Output Attributes
LAYER Port Attributes
Each feature exiting the LAYER port will have the following attributes populated from the config file:
Attribute
Description
layerName
The unique identifier or name of the layer (e.g., my_wms_layer).
layerTitle
The human-readable title for the layer (e.g., My Awesome WMS Layer).
layerAbstract
The descriptive text or abstract for the layer.
layerSource
The name of the source this layer is connected to.
sourceUrl
The full URL for the layer's data source (e.g., WMS/WFS GetMap/GetFeature URL).
layerAttributes
A list attribute containing the configured attributes (infoclick attributes) for the layer. This includes elements like layerAttributes{}.name and layerAttributes{}.title.
layerStyle
The name of the style applied to the layer.
...and more
Additional attributes such as projection, type, queryable, visible, etc., may be exposed depending on what is defined for the layer in the configuration file.
JSON Port Attributes
The feature exiting the JSON port will have the following attributes:
Attribute
Description
originalConfigJson
The raw, unmodified content of the Origo configuration file, including all original comments.
cleanedConfigJson
The JSON content of the configuration file after all single-line (//) and multi-line (/* ... */) comments have been removed.
Would you like to know more? Click here to find out more details!