From 3c39111c86b91fa16095030e7c67f993d8000db6 Mon Sep 17 00:00:00 2001 From: "lmarnat14@gmail.com" Date: Thu, 16 Dec 2021 09:31:18 +0100 Subject: [PATCH] CityTiler and CityTemporalTiler use the same config path CityTiler and CityTemporalTiler now use the same `--db_config_path` flag. This avoids conflicts between `db_config_path` from the CityTiler and `--db_config_path` from the CityTemporalTiler --- py3dtilers/CityTiler/CityTemporalTiler.py | 5 ----- py3dtilers/CityTiler/CityTiler.py | 10 +++++----- py3dtilers/CityTiler/README.md | 20 ++++++++++---------- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/py3dtilers/CityTiler/CityTemporalTiler.py b/py3dtilers/CityTiler/CityTemporalTiler.py index a966c337..34f25b80 100644 --- a/py3dtilers/CityTiler/CityTemporalTiler.py +++ b/py3dtilers/CityTiler/CityTemporalTiler.py @@ -22,11 +22,6 @@ class CityTemporalTiler(CityTiler): def __init__(self): super().__init__() - self.parser.add_argument('--db_config_path', - nargs='+', - default='CityTilerDBConfig.yml', - type=str, - help='Path(es) to the database configuration file(s)') self.parser.add_argument('--time_stamps', nargs='+', type=str, diff --git a/py3dtilers/CityTiler/CityTiler.py b/py3dtilers/CityTiler/CityTiler.py index 12193bc4..b8d0647e 100644 --- a/py3dtilers/CityTiler/CityTiler.py +++ b/py3dtilers/CityTiler/CityTiler.py @@ -18,11 +18,11 @@ def __init__(self): super().__init__() # adding positional arguments - self.parser.add_argument('db_config_path', - nargs='?', + self.parser.add_argument('--db_config_path', + nargs='*', default='py3dtilers/CityTiler/CityTilerDBConfig.yml', - type=str, # why precise this if it is the default config ? - help='path to the database configuration file') + type=str, + help='Path(es) to the database configuration file(s)') self.parser.add_argument('object_type', nargs='?', @@ -159,7 +159,7 @@ def main(): city_tiler.parse_command_line() args = city_tiler.args - cursor = open_data_base(args.db_config_path) + cursor = open_data_base(args.db_config_path[0]) if args.object_type == "building": objects_type = CityMBuildings diff --git a/py3dtilers/CityTiler/README.md b/py3dtilers/CityTiler/README.md index d67919fc..9ba554d7 100644 --- a/py3dtilers/CityTiler/README.md +++ b/py3dtilers/CityTiler/README.md @@ -16,7 +16,7 @@ Copy and customize the [CityTilerDBConfigReference.yml](CityTilerDBConfigReferen You can then run the tiler by specifying the path to the _.yml_ configuration file: ``` -citygml-tiler /Config.yml +citygml-tiler --db_config_path /Config.yml ``` The created tileset will be placed in a folder named `junk_` in the root directory. The name of the folder will be either `junk_buildings`, `junk_reliefs`, `junk_water_bodies` or `junk_bridges`, depending on the [objects type](#objects-type) (respectively `building`, `relief`, `water` and `bridge`). @@ -31,19 +31,19 @@ By default, the tiler will treat the data as __buildings__. You can change the t * `building` ``` -citygml-tiler /Config.yml building +citygml-tiler --db_config_path /Config.yml building ``` * `relief` ``` -citygml-tiler /Config.yml relief +citygml-tiler --db_config_path /Config.yml relief ``` * `water` ``` -citygml-tiler /Config.yml water +citygml-tiler --db_config_path /Config.yml water ``` * `bridge` ``` -citygml-tiler /Config.yml bridge +citygml-tiler --db_config_path /Config.yml bridge ``` ### LOA @@ -51,7 +51,7 @@ Using the LOA\* option creates a tileset with a __refinement hierarchy__. The le To use the LOA option: ``` -citygml-tiler /Config.yml --loa +citygml-tiler --db_config_path /Config.yml --loa ``` \*_LOA (Level Of Abstraction): here, it is simple 3D extrusion of a polygon._ @@ -61,7 +61,7 @@ Using the LOD1 option creates a tileset with a __refinement hierarchy__. The lea To use the LOD1 option: ``` -citygml-tiler /Config.yml --lod1 +citygml-tiler --db_config_path /Config.yml --lod1 ``` ### Textures @@ -69,7 +69,7 @@ By default, the objects are created without their texture. To add texture: ``` -citygml-tiler /Config.yml --with_texture +citygml-tiler --db_config_path /Config.yml --with_texture ``` ### Split surfaces @@ -77,14 +77,14 @@ By default, the tiler merges the surfaces of the same CityObject into one geomet To keep the surfaces split: ``` -citygml-tiler /Config.yml --split_surfaces +citygml-tiler --db_config_path /Config.yml --split_surfaces ``` ### Batch Table Hierarchy The Batch table hierarchy is a [Batch Table](https://github.com/CesiumGS/3d-tiles/blob/main/specification/TileFormats/BatchTable/README.md) extension. This extension creates a link between the buildings and their surfaces. To create the BatchTableHierarchy extension: ``` -citygml-tiler /Config.yml --with_BTH +citygml-tiler --db_config_path /Config.yml --with_BTH ``` # City Temporal Tiler