topo_map_processor 0.1.22__tar.gz → 0.1.23__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.22
3
+ Version: 0.1.23
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
@@ -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.22'
32
- __version_tuple__ = version_tuple = (0, 1, 22)
31
+ __version__ = version = '0.1.23'
32
+ __version_tuple__ = version_tuple = (0, 1, 23)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -50,11 +50,14 @@ def cli():
50
50
  parser = argparse.ArgumentParser(description="End-to-end retiling script.")
51
51
  parser.add_argument("-p", "--pmtiles-release", required=True, help="PMTiles release tag")
52
52
  parser.add_argument("-g", "--gtiffs-release", required=True, help="GeoTIFFs release tag")
53
+ parser.add_argument("-r", "--repo", required=False, help="Github repo to download from and upload to")
53
54
  parser.add_argument("-x", "--pmtiles-prefix", required=True, help="Prefix for PMTiles files")
54
55
  parser.add_argument("--bounds-file-tiled", required=True, help="Name of the bounds file in the pmtiles release (the old bounds file)")
55
56
  parser.add_argument("--no-cache", action='store_true', required=False, help="Don't cache files locally during pmtiles partitioning")
56
57
  args = parser.parse_args()
57
58
 
59
+ repo_arg = ["--repo", args.repo] if args.repo else []
60
+
58
61
  # Define paths and filenames
59
62
  sheets_to_pull_list_outfile = Path("sheets_to_pull_list.txt")
60
63
  tiles_dir = Path("staging/tiles/")
@@ -75,10 +78,10 @@ def cli():
75
78
 
76
79
  # Download bounds files
77
80
  print("Downloading new bounds file from gtiffs release...")
78
- run_command(["gh", "release", "download", args.gtiffs_release, "-p", "bounds.geojson", "--clobber", "-O", str(new_bounds_file)])
81
+ run_command(["gh", "release", "download", args.gtiffs_release, "-p", "bounds.geojson", "--clobber", "-O", str(new_bounds_file)] + repo_arg)
79
82
 
80
83
  print("Downloading old bounds file from pmtiles release...")
81
- run_command(["gh", "release", "download", args.pmtiles_release, "-p", args.bounds_file_tiled, "--clobber", "-O", str(old_bounds_file)])
84
+ run_command(["gh", "release", "download", args.pmtiles_release, "-p", args.bounds_file_tiled, "--clobber", "-O", str(old_bounds_file)] + repo_arg)
82
85
 
83
86
  # Create force redo bounds file
84
87
  print("Creating force redo bounds file...")
@@ -98,7 +101,7 @@ def cli():
98
101
 
99
102
  # Download original PMTiles
100
103
  print("Getting original PMTiles files...")
101
- run_command(["gh", "release", "download", args.pmtiles_release, "-D", str(from_pmtiles_dir), "-p", f"{args.pmtiles_prefix}*"])
104
+ run_command(["gh", "release", "download", args.pmtiles_release, "-D", str(from_pmtiles_dir), "-p", f"{args.pmtiles_prefix}*"] + repo_arg)
102
105
 
103
106
  # Get list of sheets to pull
104
107
  print("Getting list of sheets to pull...")
@@ -115,11 +118,12 @@ def cli():
115
118
  # Download TIFFs
116
119
  print("Downloading TIFFs...")
117
120
  # The download script will report if files are not found, which is expected for dummy sheets.
118
- if download_from_release_main([
121
+ download_args = [
119
122
  "--release", args.gtiffs_release,
120
123
  "--output-dir", str(tiffs_dir),
121
124
  "--file-list", str(sheets_to_pull_list_outfile),
122
- ]) != 0:
125
+ ] + repo_arg
126
+ if download_from_release_main(download_args) != 0:
123
127
  print("Some TIFFs failed to download. This may be expected for dummy sheets from force redo. Continuing...", file=sys.stderr)
124
128
 
125
129
  sheets_to_pull_list_outfile.unlink()
@@ -150,18 +154,18 @@ def cli():
150
154
  print("Deleting old PMTiles files from the release...")
151
155
  old_pmtiles = glob.glob(f"{from_pmtiles_dir}/{args.pmtiles_prefix}*")
152
156
  for pmtile in old_pmtiles:
153
- run_command(["gh", "release", "delete-asset", args.pmtiles_release, Path(pmtile).name, "-y"])
157
+ run_command(["gh", "release", "delete-asset", args.pmtiles_release, Path(pmtile).name, "-y"] + repo_arg)
154
158
 
155
159
  print("Uploading new PMTiles files...")
156
160
  new_pmtiles = glob.glob(f"{to_pmtiles_prefix}*")
157
- run_command(["gh", "release", "upload", args.pmtiles_release, "--clobber"] + new_pmtiles)
161
+ run_command(["gh", "release", "upload", args.pmtiles_release, "--clobber"] + repo_arg + new_pmtiles)
158
162
 
159
163
  # Handle bounds file
160
164
  print("Uploading new bounds file to pmtiles release...")
161
165
  upload_bounds_file = Path(args.bounds_file_tiled)
162
166
  new_bounds_file.rename(upload_bounds_file)
163
167
 
164
- run_command(["gh", "release", "upload", args.pmtiles_release, str(upload_bounds_file), "--clobber"])
168
+ run_command(["gh", "release", "upload", args.pmtiles_release, str(upload_bounds_file), "--clobber"] + repo_arg)
165
169
 
166
170
  upload_bounds_file.unlink()
167
171