Export Configuration

The configuration settings of the export citygml-adv are defined in the "advExportOptions" section. The following example shows the corresponding JSON structure:

{
  "advExportOptions": {
    "attributeMappings": { ... },
    "attributeFilters": { ... }
  }
}

Attribute mapping

Using the "attributeMappings" JSON object, the values of existing attributes in the database can be mapped to AdV-compliant attributes. This allows existing attributes to be used for an AdV-compliant export without having to rename them according to the AdV requirements. If the target attribute also exists in the database, the mapping overwrites its value in the export output. The mappings are applied before attribute filtering.

The attribute mapping must be defined per feature type and may only reference attributes of that feature type. The following snippet shows an example of mapping attributes at the building level for the bldg:Building feature type.

{
  "attributeMappings": {
    "bldg:Building": [
      {
        "from": "ALKIS_AGS",
        "to": "Gemeindeschluessel",
        "defaultValue": "unbekannt"
      },
      {
        "from": "LAST_UPDATED",
        "to": "LetzteAenderung",
        "defaultValue": "@core:lastModificationDate@"
      }
    ]
  }
}

Multiple attribute mappings can be defined per feature type in a JSON array. Each attribute mapping is defined by its own JSON object.

Property Description Default value

from

Qualified name of the source attribute in the form prefix:Name. For generic attributes, the prefix can be omitted.

to

Name of the target attribute without a prefix. The target attribute is always output as a generic string attribute. Predefined CityGML attributes cannot be overwritten.

defaultValue

Optional default value for the target attribute. This value is used if the source attribute is not populated for the current object. If defaultValue is omitted, no mapping takes place.

A token in the form @prefix:Name@ can also be specified as the default value, referencing another attribute of the same object. The default value is then read from that attribute. For generic attributes, the prefix can again be omitted. If an attribute referenced by a token is missing, the token is replaced with an empty string.

Attribute filter

Attribute filters control which attributes of the respective feature type are written to the output file. This allows the AdV standard’s requirements for mandatory and permitted attributes to be overridden.

As with attribute mapping, attribute filters are also defined separately for each feature type, such as bldg:Building or brid:Bridge, and may only reference attributes of that feature type.

{
  "attributeFilters": {
    "brid:Bridge": {
      "keep": ["ALKIS_AGS", "core:terminationDate"],
      "remove": ["brid:address"]
    }
  }
}

A list of attributes to write and to remove can be defined per feature type. Both lists are optional.

Property Description Default value

keep

List of attributes in the form prefix:Name that should be written to the output file. For generic attributes, the prefix can be omitted. keep explicitly retains attributes even if they are not permitted by the AdV standard.

remove

List of attributes in the form prefix:Name that should not be written to the output file. For generic attributes, the prefix can be omitted. remove explicitly removes attributes required by the AdV standard.

  • If the same attribute is listed in both keep and remove, and the attribute is mandatory under the AdV standard, remove takes precedence; otherwise, keep takes precedence.

  • Target attributes from an attribute mapping automatically have the status keep.