viewtif 0.1.7__py3-none-any.whl → 0.1.9__py3-none-any.whl
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.
- viewtif/tif_viewer.py +21 -1
- {viewtif-0.1.7.dist-info → viewtif-0.1.9.dist-info}/METADATA +7 -3
- viewtif-0.1.9.dist-info/RECORD +5 -0
- viewtif-0.1.7.dist-info/RECORD +0 -5
- {viewtif-0.1.7.dist-info → viewtif-0.1.9.dist-info}/WHEEL +0 -0
- {viewtif-0.1.7.dist-info → viewtif-0.1.9.dist-info}/entry_points.txt +0 -0
viewtif/tif_viewer.py
CHANGED
|
@@ -170,6 +170,26 @@ class TiffViewer(QMainWindow):
|
|
|
170
170
|
self.tif_path = self.tif_path or (os.path.commonprefix([red, green, blue]) or red)
|
|
171
171
|
|
|
172
172
|
elif tif_path:
|
|
173
|
+
# ---------------- Handle File Geodatabase (.gdb) ---------------- #
|
|
174
|
+
if tif_path.lower().endswith(".gdb") and ":" not in tif_path:
|
|
175
|
+
import re, subprocess
|
|
176
|
+
gdb_path = tif_path # use full path to .gdb
|
|
177
|
+
try:
|
|
178
|
+
out = subprocess.check_output(["gdalinfo", "-norat", gdb_path], text=True)
|
|
179
|
+
rasters = re.findall(r"RASTER_DATASET=(\S+)", out)
|
|
180
|
+
if not rasters:
|
|
181
|
+
print(f"[WARN] No raster datasets found in {os.path.basename(gdb_path)}.")
|
|
182
|
+
sys.exit(0)
|
|
183
|
+
else:
|
|
184
|
+
print(f"Found {len(rasters)} raster dataset{'s' if len(rasters) > 1 else ''}:")
|
|
185
|
+
for i, r in enumerate(rasters):
|
|
186
|
+
print(f"[{i}] {r}")
|
|
187
|
+
print("\nUse one of these names to open. For example, to open the first raster:")
|
|
188
|
+
print(f'viewtif "OpenFileGDB:{gdb_path}:{rasters[0]}"')
|
|
189
|
+
sys.exit(0)
|
|
190
|
+
except subprocess.CalledProcessError as e:
|
|
191
|
+
print(f"[WARN] Could not inspect FileGDB: {e}")
|
|
192
|
+
sys.exit(0)
|
|
173
193
|
# --- Universal size check before loading ---
|
|
174
194
|
warn_if_large(tif_path, scale=self._scale_arg)
|
|
175
195
|
# --------------------- Detect HDF/HDF5 --------------------- #
|
|
@@ -678,7 +698,7 @@ def run_viewer(
|
|
|
678
698
|
import click
|
|
679
699
|
|
|
680
700
|
@click.command()
|
|
681
|
-
@click.version_option("1.0.
|
|
701
|
+
@click.version_option("1.0.9", prog_name="viewtif")
|
|
682
702
|
@click.argument("tif_path", required=False)
|
|
683
703
|
@click.option("--band", default=1, show_default=True, type=int, help="Band number to display")
|
|
684
704
|
@click.option("--scale", default=1.0, show_default=True, type=float, help="Scale factor for display")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: viewtif
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.9
|
|
4
4
|
Summary: Lightweight GeoTIFF, HDF/HDF5, and Esri File Geodatabase (.gdb) viewer with shapefile overlay and large-raster safeguard.
|
|
5
5
|
Project-URL: Homepage, https://github.com/nkeikon/tifviewer
|
|
6
6
|
Project-URL: Source, https://github.com/nkeikon/tifviewer
|
|
@@ -87,12 +87,16 @@ viewtif AG100.v003.33.-107.0001.h5 --subset 1 --band 3
|
|
|
87
87
|
|
|
88
88
|
### Update in v1.0.7: File Geodatabase (.gdb) support
|
|
89
89
|
`viewtif` can now open raster datasets stored inside Esri File Geodatabases (`.gdb`), using the GDAL `OpenFileGDB` driver.
|
|
90
|
+
When you open a .gdb directly, `viewtif`` will list available raster datasets first, then you can choose one to view.
|
|
90
91
|
|
|
91
92
|
```bash
|
|
92
|
-
#
|
|
93
|
+
# List available raster datasets
|
|
94
|
+
viewtif /path/to/geodatabase.gdb
|
|
95
|
+
|
|
96
|
+
# Open a specific raster
|
|
93
97
|
viewtif "OpenFileGDB:/path/to/geodatabase.gdb:RasterName"
|
|
94
98
|
```
|
|
95
|
-
> **Note:** Requires GDAL 3.7 or later with the OpenFileGDB driver enabled. The .gdb path and raster name must be separated by a colon (:).
|
|
99
|
+
> **Note:** Requires GDAL 3.7 or later with the OpenFileGDB driver enabled. If multiple raster datasets are present, viewtif lists them all and shows how to open each. The .gdb path and raster name must be separated by a colon (:).
|
|
96
100
|
|
|
97
101
|
### Update in v1.0.7: Large raster safeguard
|
|
98
102
|
As of v1.0.7, `viewtif` automatically checks the raster size before loading.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
viewtif/tif_viewer.py,sha256=huQInI8s-OxgoxqLPy0QzzRh4OTRZHOG2QE_0llK-Dw,29612
|
|
2
|
+
viewtif-0.1.9.dist-info/METADATA,sha256=vKcAT60CbNgz5Ax-XahxEuhZhU4ZRS8tgb-Z_WVOM9Q,6234
|
|
3
|
+
viewtif-0.1.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
4
|
+
viewtif-0.1.9.dist-info/entry_points.txt,sha256=NVEjlRyJ7R7hFPOVsZJio3Hl0VqlX7_oVfA7819XvHM,52
|
|
5
|
+
viewtif-0.1.9.dist-info/RECORD,,
|
viewtif-0.1.7.dist-info/RECORD
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
viewtif/tif_viewer.py,sha256=DR9yvZMfxQWbhVYGuFdrEvMkaV3glH2yeFTpG4D2WAs,28385
|
|
2
|
-
viewtif-0.1.7.dist-info/METADATA,sha256=u9jdbLvL6wN60olRAsXWCFIHM6WA-Dli_jLIb0iVatQ,5942
|
|
3
|
-
viewtif-0.1.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
4
|
-
viewtif-0.1.7.dist-info/entry_points.txt,sha256=NVEjlRyJ7R7hFPOVsZJio3Hl0VqlX7_oVfA7819XvHM,52
|
|
5
|
-
viewtif-0.1.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|