citygml4j / citygml-tools

Collection of tools for processing CityGML files
Apache License 2.0
115 stars 18 forks source link

How to include extensions? #46

Open c0nb4 opened 1 year ago

c0nb4 commented 1 year ago

Hello everyone,

if I want to reproject a file with the "rerpoject" command, the following error is shown:

[12:26:22 WARN] The input file uses unsupported non-CityGML namespace(s): http://www.sig3d.org/citygml/2.0/energy/1.0, http://www.opengis.net/wfs/2.0. [12:26:22 INFO] Non-CityGML content is skipped unless a matching ADE extension has been loaded.

I use the following command and the EnergyADE FZK-Haus for an example.

reproject --source-crs=25832 --target-crs=new_coordinate_system --extensions=path_to_ade

clausnagel commented 1 year ago

citygml-tools does not provide generic support for CityGML ADEs like the EnergyADE that you are using in your dataset. The tool uses citygml4j as library for parsing and processing CityGML files. To enable support for a specific ADE, you have to implement a citygml4j extension for this ADE in Java and then provide the compiled version of your extension via the --extensions parameter as shown in your post.

The latest version 2.x of citygml-tools uses citygml4j 3.x as parser. Unfortunately, I am not aware of a freely available EnergyADE extension for citygml4j 3.x that you could simply download and use.

However, the previous version 1.x of citygml-tools is based on citygml4j 2.x. And for this version of citygml4j, there is an open source extension for the EnergyADE: https://github.com/citygml4j/energy-ade-citygml4j. It is implemented against the Karlsruhe Institute of Technology (KIT) profile of the EnergyADE version 1.0 (see the readme at the provided link for more information). If your data also uses the KIT profile, then you can try the following steps:

  1. Download citygml-tools version 1.4.5 as ZIP package from https://github.com/citygml4j/citygml-tools/releases/tag/v1.4.5.
  2. Unzip the package to some location on your local machine.
  3. Download the EnergyADE citygml4j extension as ZIP package from https://github.com/citygml4j/energy-ade-citygml4j/releases/tag/v1.0.4.
  4. Unzip the EnergyADE package into the ade-extensions subfolder where you unzipped citygml-tools in step 2.
  5. Run citygml-tools reproject ... from the folder created in step 2. Be careful, some of the parameters might have changed between versions 1.x and 2.x of citygml-tools.

Hope this helps.