Skip to content

Commit

Permalink
Merge pull request #31 from VCityTeam/fix-config_path
Browse files Browse the repository at this point in the history
CityTiler and CityTemporalTiler use the same config path
  • Loading branch information
DiegoVinasco authored Dec 16, 2021
2 parents f115ac3 + 3c39111 commit c78fdf1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 20 deletions.
5 changes: 0 additions & 5 deletions py3dtilers/CityTiler/CityTemporalTiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions py3dtilers/CityTiler/CityTiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='?',
Expand Down Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions py3dtilers/CityTiler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <path_to_file>/Config.yml
citygml-tiler --db_config_path <path_to_file>/Config.yml
```

The created tileset will be placed in a folder named `junk_<objects-type>` 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`).
Expand All @@ -31,27 +31,27 @@ By default, the tiler will treat the data as __buildings__. You can change the t

* `building`
```
citygml-tiler <path_to_file>/Config.yml building
citygml-tiler --db_config_path <path_to_file>/Config.yml building
```
* `relief`
```
citygml-tiler <path_to_file>/Config.yml relief
citygml-tiler --db_config_path <path_to_file>/Config.yml relief
```
* `water`
```
citygml-tiler <path_to_file>/Config.yml water
citygml-tiler --db_config_path <path_to_file>/Config.yml water
```
* `bridge`
```
citygml-tiler <path_to_file>/Config.yml bridge
citygml-tiler --db_config_path <path_to_file>/Config.yml bridge
```

### LOA
Using the LOA\* option creates a tileset with a __refinement hierarchy__. The leaves of the created tree are the detailed features (features loaded from the data source) and their parents are LOA geometries of those detailed features. The LOA geometries are 3D extrusions of polygons. The polygons must be given as a path to a Geojson file, or a directory containing Geojson file(s) (the features in those geojsons must be Polygons or MultiPolygons). The polygons can for example be roads, boroughs, rivers or any other geographical partition.

To use the LOA option:
```
citygml-tiler <path_to_file>/Config.yml --loa <path-to-polygons>
citygml-tiler --db_config_path <path_to_file>/Config.yml --loa <path-to-polygons>
```

\*_LOA (Level Of Abstraction): here, it is simple 3D extrusion of a polygon._
Expand All @@ -61,30 +61,30 @@ Using the LOD1 option creates a tileset with a __refinement hierarchy__. The lea

To use the LOD1 option:
```
citygml-tiler <path_to_file>/Config.yml --lod1
citygml-tiler --db_config_path <path_to_file>/Config.yml --lod1
```

### Textures
By default, the objects are created without their texture.

To add texture:
```
citygml-tiler <path_to_file>/Config.yml --with_texture
citygml-tiler --db_config_path <path_to_file>/Config.yml --with_texture
```

### Split surfaces
By default, the tiler merges the surfaces of the same CityObject into one geometry. When using the `split_surfaces` flag, all surfaces will be an independent geometry.

To keep the surfaces split:
```
citygml-tiler <path_to_file>/Config.yml --split_surfaces
citygml-tiler --db_config_path <path_to_file>/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 <path_to_file>/Config.yml --with_BTH
citygml-tiler --db_config_path <path_to_file>/Config.yml --with_BTH
```

# City Temporal Tiler
Expand Down

0 comments on commit c78fdf1

Please sign in to comment.