.. _impexp_cli_export_vis_command: Visualization export command ---------------------------- **Synopsis** .. code-block:: bash impexp export-vis [-hjVz] [--ade-extensions=] [-c=] [--log-file=] [--log-level=] -o= [--pid-file=] [--plugins=] [--use-plugin=[,...]]... [--worker-threads=] [-D=[,...] [-D=
[,...]]... -l=<0..4 | halod> [-a=]] [[[-t=<[prefix:]name>[,<[prefix:] name>...]]... [--namespace=[, ...]]...] [[-r=] [-R=]] [-i=[,...] [-i=[, ...]]...] [-b=] [-g=] [-s= Provide an SQL SELECT statement to be used as SQL filter when querying the database. In general, any SELECT statement can be used as long as it returns a list of database IDs of the selected city objects (see :numref:`impexp_export_vis_sql_filter` for more information). You can also use an @-file to provide the SELECT statement (see :numref:`impexp_cli_argument_files`). **COLLADA/glTF rendering options** The following options are specific to COLLADA/glTF exports. They are ignored if the list of display forms given by the :option:`--display-form` option does not contain the value ``collada``. .. option:: -B, --double-sided Flag to disable backface culling and rather force a viewer to render both sides of each polygons. Be aware that this might decrease the visualization performance. .. option:: --no-surface-normals If this flag is set, surface normals of polygons are not stored in the output. When exporting textured models, surface normals often do not increase the visual quality and can be omitted. .. option:: -C, --crop-textures Use this flag to let the export operation cut each texture image to the minimum size required for texturing the corresponding polygon. This option can help to avoid loading massive texture data into a viewer. .. option:: -f, --texture-scale-factor=<0..1> Scale down texture images by the given factor. A value between ``0`` and ``1`` must be provided. The default value of ``1`` means no scaling. .. option:: -x, --texture-atlas= Specify if and how texture atlases should be created for each top-level feature from the exported texture images. Allowed values are ``none``, ``basic``, ``tpim``, and ``tpim_wo_rotation``. By default, texture atlases are created for all visualization exports using the ``basic`` mode. Use ``none`` to disable the creation of texture atlases. The further values correspond to the names of the supported algorithms for creating texture atlases as described in :numref:`impexp_kml_export_preferences_general_chapter`. .. option:: --no-pot-atlases By default, texture atlases are created with power-of-two (PoT) side lengths. Use this flag to disable the default behaviour. **glTF export options** The ``export-vis`` command supports exporting glTF models by converting the COLLADA output to glTF on the fly. This is achieved by using the open source `COLLADA2glTF `_ converter tool. The following options control the glTF export. .. option:: -G, --gltf Set this flag on your command line to enable the glTF export. This requires that ``collada`` has been selected as display form with the :option:`--display-form` option. .. option:: --gltf-version= Specify the glTF version to use for the export. Allowed values are ``1.0`` and ``2.0`` (default). .. option:: --gltf-converter= Provide the path to the executable of the COLLADA2glTF converter tool. By default, the COLLADA2glTF tool shipped with the Importer/Exporter is used in the conversion. Be careful when using a different version of the tool as this might result in unexpected behaviour. More information is provided in :numref:`impexp_kml_export_preferences_general_chapter`. .. option:: --gltf-embed-textures By default, texture images are exported as separate files relative to the location of the glTF output. With this flag, texture images are rather embedded in the glTF files by encoding the texture data using a base 64 encoding. .. option:: --gltf-binary Flag to indicate that the glTF output should be converted and compressed to binary glTF format. .. option:: --gltf-draco-compression Flag to indicate that geometry data should be compressed using the `Google Draco compression technology `_. Draco compression is only available for glTF version 2.0, so make sure the :option:`--gltf-version` option is correctly set. .. option:: -m, --remove-collada Use this flag to remove the COLLADA files after the conversion and only keep the glTF output as result. .. include:: database-options.rst **Examples** .. code-block:: bash $ impexp export-vis -T oracle -H localhost -d citydb_v4 -u citydb_user -p my_password \ -D collada -l 2 -a visual -o my_vis.kml Export all city objects from the database as COLLADA in LoD2. The appearance theme ``visual`` is used for texturing/coloring the objects. The output is stored in the main KML file ``my_vis.kml`` that can be loaded with a viewer. The 3DCityDB to connect to is supposed to be running on an Oracle database on the same machine. The connection will be established to the ``citydb_v4`` database with the user ``citydb_user`` and the password ``my_password``. .. code-block:: bash $ impexp export-vis -H localhost -d citydb_v4 -u citydb_user -p my_password \ -D footprint=50,extruded=125,collada=200 -l halod \ -t Building -b 13.3508824,52.4799281,13.3578297,52.4862805,4326 \ -g 3,4 -o my_vis.kml Export all ``Building`` features inside the given bounding box as ``footprint``, ``extruded`` and ``collada`` models using their highest available LoD representation. Tiling is enabled for this export, and 3x4 tiles are created per display form. Each display form is assigned a different visibility value. A ``footprint`` tile will become visible in the viewer as soon as it occupies 50 square pixels of screen space. When zooming in, the viewer will switch to ``extruded`` and finally to ``collada`` as soon as their visibility value is reached. .. code-block:: bash $ impexp export-vis -H localhost -d citydb_v4 -u citydb_user -p my_password \ -D geometry -l 2 \ -t CityFurniture,Bridge -g auto \ -z -j -o my_vis.kml Export all ``CityFurniture`` and ``Bridge`` objects as ``geometry`` from LoD2. Again, tiling is applied to the export. Since a :option:`--bbox` option is not provided, the bounding box is automatically calculated from all features. This bounding box is then automatically tiled using a default side length of 125m per tile. Moreover, each tile file is compressed as ZIP archive and an additional JSON file containing metadata about all exported features is created. .. code-block:: bash $ impexp export-vis -H localhost -d citydb_v4 -u citydb_user -p my_password \ -D collada -l halod \ -i ID_0815,ID_0816 --double-sided \ -a visual -x tpim_wo_rotation -C \ -o my_vis.kml Export the top-level city objects with the identifiers ``ID_0815`` and ``ID_0816`` as ``collada`` using their highest available LoD representation. Textures shall be exported from the appearance theme ``visual``. The texture images are first cropped and then packaged into texture atlases using the ``tpim_wo_rotation`` algorithm. Moreover, backface culling is disabled for this export. .. code-block:: bash $ impexp export-vis -H localhost -d citydb_v4 -u citydb_user -p my_password \ -D collada -l 3 \ -s "select cityobject_id from cityobject_genericattrib \ where attrname='energy_level' and realval < 12" \ -G --gltf-binary --gltf-draco-compression -m -o my_vis.kml Export all city objects satisfying the given SQL SELECT statement as ``collada`` based on their LoD3 geometries. The models are converted to binary glTF format and Draco compression is applied to the geometries. The intermediate COLLADA output is removed for the final result.