files
Working with file inputs and outputs
BadArchiveError
¶
Bases: OSError
The archive contains a bad file
Source code in bag3d/common/utils/files.py
14 15 16 17 |
|
bag3d_dir(root_dir)
¶
The 3D BAG data directory
Source code in bag3d/common/utils/files.py
45 46 47 |
|
bag3d_export_dir(root_dir, version)
¶
Create the 3DBAG export directory if does not exist
Source code in bag3d/common/utils/files.py
55 56 57 58 59 |
|
check_export_results(path_quadtree_tsv, path_tiles_dir)
¶
Parse the quadtree.tsv
written by tyler, check if all formats exists for each
tile, add the tile WKT.
Returns:
Type | Description |
---|---|
Iterator[ExportResult]
|
Generator of ExportResult |
Source code in bag3d/common/utils/files.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
geoflow_crop_dir(root_dir)
¶
Directory for the Geoflow crop-reconstruct output
Source code in bag3d/common/utils/files.py
50 51 52 |
|
get_export_tile_ids()
¶
Get the IDs of the distribution tiles from the file system.
It reads the quadtree.tsv
output from tyler and extracts the IDs of the
leaf tiles.
Returns:
Type | Description |
---|---|
Sequence[str]
|
List of tile IDs |
Source code in bag3d/common/utils/files.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
|
unzip(file, dest, remove=True)
¶
Uncompress the whole zip archive and optionally delete the zip.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file
|
Path
|
The Path to the zip. |
required |
dest
|
Path
|
The Path to the destination directory. |
required |
remove
|
bool
|
Whether to remove the zip. |
True
|
Raises:
Type | Description |
---|---|
BadArchiveError
|
The archive contains at least one bad file |
Source code in bag3d/common/utils/files.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|