citygml4j / citygml-tools

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

stream output to stdout? #33

Closed pcace closed 1 year ago

pcace commented 1 year 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 1 year 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 1 year ago

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

clausnagel commented 1 year ago

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

pcace commented 1 year 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 :/ )