citygml4j / citygml-tools

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

stream output to stdout? #33

Closed pcace closed 2 years ago

pcace commented 2 years ago

Hi,

is there any possibility to stream the output of for example citygml-tools to-cityjson *.xml to a specific file or better to stdout? i am trying to use the citygml-tools from a nodejs application and further work with the outputted json directly. Is there a way? Or: would there be an easier way to integrate the citygml-tools into my own nodejs application?

Thanks a lot!

clausnagel commented 2 years ago

This is currently not possible. Suppose you let the tool work on multiple directories which themselves have multiple nested directories containing the input files. How would you write the converted output files to a single output folder or even a stream? And the input files can contain references to external files such as texture images or library objects. How to rewrite these references if the output files should be written, for example, to another disk or even machine?

Due to these open questions, I decided to let the tool create the output files in the same directory as the input files.

pcace commented 2 years ago

Hi, thank you for your explanation. I can totally understand it.

clausnagel commented 2 years ago

Maybe you have a proposal for doing it differently? I am open for changes.

pcace commented 2 years ago

hmm currently not really - i am using it from a child-process now. I just thought it would be a little cleaner / safer not to have the need to write files to a location, but rather keep them somewhere in memory. (if i am honest, when i asked the question i didn even realized that you are able to convert more then one file at once.... i thought it is a one file in one file out operation. there it would have been easier :/ )