3dcitydb / importer-exporter

3D City Database client for high-performance import and export of 3D city model data
Apache License 2.0
126 stars 54 forks source link

On-the-fly glTF creation #12

Closed nextstopsun closed 7 years ago

nextstopsun commented 8 years ago

Is it possible to create glTF from 3DcityDB on demand? For now we can only export by export tool once in a while. So if data in the database changes, we have to reexport changed models once again.

Ideally it could be a database function that returns glTF-encoded data for a requested object.

yaozhihang commented 8 years ago

The KML/COLLADA/glTF Exporter privides a filter option that allows you to export a single CityGML object according to its GMLID (Please refer to the pages 135-136 of the 3DCityDB-Documentation-3.3). Once the glTF object has been exported, you can simply copy it and replace the old one in your previously created glTF datasets.

nextstopsun commented 8 years ago

@yaozhihang Thanks for a reply. So how do I handle the case when I don't need a glTF file itself, but rather want to generate glTF output directly from the database to other software (i.e. web server) without the additional step of creating and storing files?

yaozhihang commented 8 years ago

Sorry, I've no idea how to handle this case using the 3DCityDB. Since the current version of the KML/COLLADA/glTF Exporter uses the collada2glTF tool to create glTF models, only glTF files can be created.

clausnagel commented 8 years ago

The importer/exporter tool export can be run from the command line. You can issue a KML/COLLADA/glTF export using the -kmlExport flag. Filter criteria can be provided as separate configuration file through the -config parameter. Read more about the command line interface (CLI) in chapter 5.8 of the version 3.3 documentation.

Using the CLI, all you have to do is implement a service interface that would accept a client's request, create a corresponding configuration file, invoke a KML/COLLADA/glTF export and return the glTF output to the client. The overhead of using temporary file remains, but is hidden from the client.

clausnagel commented 7 years ago

Closing this issue. Feel free to re-open if you have further questions.