Import CityJSON Command
The import cityjson
command imports one or more CityJSON files into the VCDB v5
.
Options
The import cityjson
command inherits global options from the main vcdb
command and general import,
metadata, and filter options from its parent import
command. Additionally, it provides CityJSON
format-specific import options.
Global options
Option | Description | Default value |
---|---|---|
|
One or more argument files containing options. |
|
|
Show a help message and exit. |
|
|
Print version information and exit. |
|
|
Load configuration from this file. |
|
|
Log level: |
|
|
Write log messages to this file. |
|
|
Disable console log messages. |
|
|
Create a file containing the process ID. |
|
|
Load plugins from this directory. |
|
|
Enable or disable plugins with a matching fully qualified class name. |
|
For more details on the global options and usage hints, see here.
General import options
Option | Description | Default value |
---|---|---|
|
One or more files and directories to process (glob patterns allowed). |
|
|
Encoding of input file(s). |
|
|
Fail fast on errors. |
|
|
Store temporary files in this directory. |
|
|
Import mode: |
|
|
Number of threads to use for parallel processing. |
|
|
Run in preview mode. Features will not be imported. |
|
|
Index mode: |
|
|
Compute and overwrite extents of features. |
|
|
Transform coordinates using a 3x4 matrix in row-major order. Use |
For more details on the general import options and usage hints, see here.
CityJSON import options
Option | Description | Default value |
---|---|---|
|
Map city objects from unsupported extensions onto generic city objects. |
|
|
Do not process appearances. |
|
|
Process appearances with a matching theme. Use |
Metadata options
Option | Description | Default value |
---|---|---|
|
Lineage to use for the features. |
|
|
Name of the user responsible for the import. |
database user |
|
Reason for importing the data. |
For more details on the metadata options and usage hints, see here.
Filter options
Option | Description | Default value |
---|---|---|
|
Names of the features to process. |
|
|
Identifiers of the features to process. |
|
|
Bounding box to use as spatial filter. |
|
|
Bounding box mode: |
|
|
Maximum number of features to process. |
|
|
Index within the input set from which features are processed. |
For more details on the filter options and usage hints, see here.
Database connection options
Option | Description | Default value |
---|---|---|
|
Name of the host on which the VCDB is running. |
|
|
Port of the VCDB server. |
5432 |
|
Name of the VCDB database to connect to. |
|
|
Schema to use when connecting to the VCDB. |
|
|
Username to use when connecting to the VCDB. |
|
|
Password to use when connecting to the VCDB. Leave empty to be prompted. |
|
|
Database-specific connection properties. |
For more details on the database connection options and usage hints, see here.
Usage
For general usage hints applicable to all subcommands of the import command (including but not limited to
import cityjson ), refer to the documentation for the import command here.
|
Supported CityJSON versions
The import cityjson
command supports importing CityJSON files in versions 2.0, 1.1, and 1.0. In addition to regular
CityJSON files, the CityJSON Text Sequence (CityJSONSeq) format is also
supported. CityJSONSeq decomposes the CityJSON dataset into its 1st-level features, which are stored as separate JSON
objects on individual lines, each delimited by newlines. This format enables efficient streaming of large CityJSON data.
The following file types and extensions are recognized by vcdb-tool:
File type | File extensions |
---|---|
CityJSON file |
|
GZIP compressed file |
|
ZIP archive |
|
The file extensions are used when a directory or ZIP archive is provided as <file>
input instead of a single file.
In such cases, the directory or archive is recursively scanned for input files, which are identified using the
extensions listed above and then processed for import.
Filtering CityJSON features
The import cityjson
command inherits filtering options from the parent import
command. In the context of CityJSON input files, the filters operate as follows:
Filter | Description |
---|---|
|
|
Applies to the |
Filters are applied to the 1st-level city objects in the input file. Matching city objects are imported, including all their 2nd-level city objects. Filtering 2nd-level city objects is not supported. |
Filtering appearances
By default, the import cityjson
command imports all appearance information from the input files. The
--appearance-theme
option restricts the import of appearances based on their "theme"
property. You can specify one
or more themes as a comma-separated list. To filter appearances that have no theme property, use none
as the value.
Only appearances associated with the specified themes will be imported. To exclude all appearances from the import, use
the --no-appearances
option.
Handling unknown extensions
CityJSON provides a flexible extension mechanism similar to CityGML Application Domain Extensions (ADE). This mechanism
allows the addition of new feature attributes and feature types not covered by the CityJSON specification. If a dataset
contains extensions that are not registered in the VCDB v5
, vcdb-tool handles them as follows:
-
Unknown attributes are mapped to generic attributes and stored in the database.
-
Unknown feature types are mapped to generic city objects in the database. This default behavior can be suppressed using the
--no-map-unknown-objects
option, which will prevent unknown feature types from being imported.
To import CityJSON extensions as defined, the corresponding type definitions have to be registered in the
OBJECTCLASS and
DATATYPE metadata tables of the VCDB v5 . Additionally, a
corresponding extension module must be loaded for vcdb-tool to correctly parse and import the extensions.
|