topo_map_processor 0.1.20__tar.gz → 0.1.22__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: topo_map_processor
3
- Version: 0.1.20
3
+ Version: 0.1.22
4
4
  Summary: Library for processing topographic maps
5
5
  Project-URL: homepage, https://github.com/ramSeraph/topo_map_processor
6
6
  Project-URL: repository, https://github.com/ramSeraph/topo_map_processor.git
@@ -303,7 +303,8 @@ tile --tiles-dir <dir> --tiffs-dir <dir> --max-zoom <zoom> --name <name> --descr
303
303
  ```
304
304
 
305
305
  - `--tiles-dir`: Directory to store the output tiles. (Required)
306
- - `--tiffs-dir`: Directory containing the input GeoTIFF files. (Required)
306
+ - `--tiffs-dir`: Directory containing the input GeoTIFF files. (Optional if `--tiffs-list-file` is used)
307
+ - `--tiffs-list-file`: File containing a list of tiff files to tile. (Optional if `--tiffs-dir` is used)
307
308
  - `--max-zoom`: Maximum zoom level for tiling. (Required)
308
309
  - `--name`: Name of the mosaic. (Required)
309
310
  - `--description`: Description of the mosaic. (Required)
@@ -226,7 +226,8 @@ tile --tiles-dir <dir> --tiffs-dir <dir> --max-zoom <zoom> --name <name> --descr
226
226
  ```
227
227
 
228
228
  - `--tiles-dir`: Directory to store the output tiles. (Required)
229
- - `--tiffs-dir`: Directory containing the input GeoTIFF files. (Required)
229
+ - `--tiffs-dir`: Directory containing the input GeoTIFF files. (Optional if `--tiffs-list-file` is used)
230
+ - `--tiffs-list-file`: File containing a list of tiff files to tile. (Optional if `--tiffs-dir` is used)
230
231
  - `--max-zoom`: Maximum zoom level for tiling. (Required)
231
232
  - `--name`: Name of the mosaic. (Required)
232
233
  - `--description`: Description of the mosaic. (Required)
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.1.20'
32
- __version_tuple__ = version_tuple = (0, 1, 20)
31
+ __version__ = version = '0.1.22'
32
+ __version_tuple__ = version_tuple = (0, 1, 22)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -52,6 +52,7 @@ def cli():
52
52
  parser.add_argument("-g", "--gtiffs-release", required=True, help="GeoTIFFs release tag")
53
53
  parser.add_argument("-x", "--pmtiles-prefix", required=True, help="Prefix for PMTiles files")
54
54
  parser.add_argument("--bounds-file-tiled", required=True, help="Name of the bounds file in the pmtiles release (the old bounds file)")
55
+ parser.add_argument("--no-cache", action='store_true', required=False, help="Don't cache files locally during pmtiles partitioning")
55
56
  args = parser.parse_args()
56
57
 
57
58
  # Define paths and filenames
@@ -143,7 +144,7 @@ def cli():
143
144
  "--from-source", f"{from_pmtiles_prefix}*.pmtiles",
144
145
  "--to-pmtiles", f"{to_pmtiles_prefix}.pmtiles",
145
146
  "--exclude-transparent"
146
- ])
147
+ ] + (["--no-cache"] if args.no_cache else []))
147
148
 
148
149
  # Upload new PMTiles and manage release assets
149
150
  print("Deleting old PMTiles files from the release...")
@@ -75,7 +75,9 @@ def cli():
75
75
 
76
76
  parser = argparse.ArgumentParser(description='Tile the GTiffs and create a TileJSON file')
77
77
  parser.add_argument('--tiles-dir', required=True, help='Directory to store the tiles')
78
- parser.add_argument('--tiffs-dir', required=True, help='Directory with GTiffs to tile')
78
+ tiffs_group = parser.add_mutually_exclusive_group(required=True)
79
+ tiffs_group.add_argument('--tiffs-dir', help='Directory with GTiffs to tile')
80
+ tiffs_group.add_argument('--tiffs-list-file', help='File containing a list of tiff files to tile')
79
81
  parser.add_argument('--max-zoom', type=int, required=True, help='Maximum zoom level for tiling')
80
82
  parser.add_argument('--min-zoom', type=int, default=0, help='Minimum zoom level for tiling')
81
83
  parser.add_argument('--tile-extension', type=str, default='webp', choices=SUPPORTED_FORMATS, help='Tile file extension (default: webp)')
@@ -102,8 +104,15 @@ def cli():
102
104
  tiles_dir = Path(args.tiles_dir)
103
105
  tiles_dir.mkdir(parents=True, exist_ok=True)
104
106
 
105
- file_names = list(glob.glob(f'{args.tiffs_dir}/*.tif'))
106
- file_names = [ str(Path(f).resolve()) for f in file_names ]
107
+ if args.tiffs_dir:
108
+ file_names = list(glob.glob(f'{args.tiffs_dir}/*.tif'))
109
+ file_names = [ str(Path(f).resolve()) for f in file_names ]
110
+ else:
111
+ tiff_list_path = Path(args.tiffs_list_file)
112
+ if not tiff_list_path.exists():
113
+ parser.error(f'Tiffs list file {args.tiffs_list_file} does not exist')
114
+ file_names = [str(Path(line.strip()).resolve()) for line in tiff_list_path.read_text().splitlines() if line.strip()]
115
+
107
116
  print(f'total files: {len(file_names)}')
108
117
 
109
118
  file_list_file = Path('files_to_tile.txt')