citygml4j / citygml-tools

Collection of tools for processing CityGML files
Apache License 2.0
124 stars 19 forks source link

to-cityjson warning: the input file uses unsupported non-CityGML namespace(s): http://www.safe.com/gml/fme. #48

Closed yuezhilanyi closed 1 year ago

yuezhilanyi commented 1 year ago

when i tryied to convert a citygml to cityjson, it failed with cmd output like below:

citygml-tools-2.1.0> .\citygml-tools.bat to-cityjson ..\gml_path\test.gml [13:14:26 INFO] Starting citygml-tools. [13:14:26 INFO] Executing 'to-cityjson' command. [13:14:26 INFO] Found 1 file(s) at ..\gml_path\test.gml. [13:14:26 INFO] [1|1] Processing file citygml-tools-2.1.0..\gml_path\test.gml. [13:14:26 WARN] The input file uses unsupported non-CityGML namespace(s): http://www.safe.com/gml/fme. [13:14:26 INFO] Non-CityGML content is skipped unless a matching ADE extension has been loaded. [13:14:26 INFO] Writing output to file citygml-tools-2.1.0..\gml_path\test.json. [13:14:26 INFO] Total execution time: 00 s. [13:14:26 INFO] citygml-tools finished with 1 warning(s).

i validated the citygml, but there is no problem:

.\citygml-tools.bat validate ..\gml_path\test.gml [13:14:19 INFO] Starting citygml-tools. [13:14:19 INFO] Executing 'validate' command. [13:14:19 INFO] Found 1 file(s) at ..\gml_path\test.gml. [13:14:20 INFO] [1|1] Validating file gml2cityjson2ifc\citygml-tools-2.1.0..\gml_path\test.gml. [13:14:21 INFO] The file is valid. [13:14:21 INFO] Validation complete. All files are valid. [13:14:21 INFO] Total execution time: 02 s. [13:14:21 INFO] citygml-tools successfully completed.

could anyone tell me, what should i do to convert it to cityjson sucessfully?

test file has been uploaded with txt postfix test.txt

clausnagel commented 1 year ago

As can be seen from the output, the process finished with a warning. This doesn't mean it failed.

yuezhilanyi commented 1 year ago

As can be seen from the output, the process finished with a warning. This doesn't mean it failed.

but the result file of cityjson has nothing in it. test-res.txt

clausnagel commented 1 year ago

Right, but that's because your input file is not CityGML. Most of your XML elements are associated with the namespace "http://www.safe.com/gml/fme" which is not an official CityGML namespace. As a consequence, citygml-tools cannot not find any CityGML content in your file that could be translated to CityJSON and, thus, the output file is empty.

I am not sure how you create your data. If you really want to output correct CityGML, then I recommend checking the official OGC Standard documents at https://www.ogc.org/standard/citygml/. For CityGML 2.0, download this PDF. In chapter 4.3, you can find a table showing the official CityGML namespaces. And there are some simple examples for CityGML 2.0 buildings at https://schemas.opengis.net/citygml/examples/2.0/building/.

yuezhilanyi commented 1 year ago

thanks very much @clausnagel

i got the gml file online, and i thought it was a citygml.