viewtif 0.1.1__py3-none-any.whl → 0.1.3__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 +33 -11
- viewtif-0.1.3.dist-info/METADATA +82 -0
- viewtif-0.1.3.dist-info/RECORD +5 -0
- viewtif-0.1.1.dist-info/METADATA +0 -23
- viewtif-0.1.1.dist-info/RECORD +0 -5
- {viewtif-0.1.1.dist-info → viewtif-0.1.3.dist-info}/WHEEL +0 -0
- {viewtif-0.1.1.dist-info → viewtif-0.1.3.dist-info}/entry_points.txt +0 -0
viewtif/tif_viewer.py
CHANGED
|
@@ -74,8 +74,8 @@ class TiffViewer(QMainWindow):
|
|
|
74
74
|
rgb: list[int] | None = None,
|
|
75
75
|
rgbfiles: list[str] | None = None,
|
|
76
76
|
shapefiles: list[str] | None = None,
|
|
77
|
-
shp_color: str = "
|
|
78
|
-
shp_width: float =
|
|
77
|
+
shp_color: str = "white",
|
|
78
|
+
shp_width: float = 2,
|
|
79
79
|
):
|
|
80
80
|
super().__init__()
|
|
81
81
|
|
|
@@ -85,7 +85,7 @@ class TiffViewer(QMainWindow):
|
|
|
85
85
|
self.rgb = rgb
|
|
86
86
|
self.rgbfiles = rgbfiles
|
|
87
87
|
|
|
88
|
-
self._scale_arg = max(1, int(scale))
|
|
88
|
+
self._scale_arg = max(1, int(scale or 1))
|
|
89
89
|
self._transform: Affine | None = None
|
|
90
90
|
self._crs = None
|
|
91
91
|
|
|
@@ -482,14 +482,36 @@ def run_viewer(
|
|
|
482
482
|
import click
|
|
483
483
|
|
|
484
484
|
@click.command()
|
|
485
|
-
@click.argument("tif_path",
|
|
486
|
-
@click.option("--
|
|
487
|
-
|
|
488
|
-
@click.option("--
|
|
489
|
-
@click.option("--
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
485
|
+
@click.argument("tif_path", required=False)
|
|
486
|
+
@click.option("--band", default=1, show_default=True, type=int, help="Band number to display")
|
|
487
|
+
@click.option("--scale", default=1.0, show_default=True, type=float, help="Scale factor for display")
|
|
488
|
+
@click.option("--rgb", nargs=3, type=int, help="Three band numbers for RGB, e.g. --rgb 4 3 2")
|
|
489
|
+
@click.option("--rgbfiles", nargs=3, type=str, help="Three single-band TIFFs for RGB, e.g. --rgbfiles B4.tif B3.tif B2.tif")
|
|
490
|
+
@click.option("--shapefile", multiple=True, type=str, help="One or more shapefiles to overlay")
|
|
491
|
+
@click.option("--shp-color", default="white", show_default=True, help="Overlay color (name or #RRGGBB).")
|
|
492
|
+
@click.option("--shp-width", default=1.0, show_default=True, type=float, help="Overlay line width (screen pixels).")
|
|
493
|
+
def main(tif_path, band, scale, rgb, rgbfiles, shapefile, shp_color, shp_width):
|
|
494
|
+
"""Lightweight GeoTIFF viewer."""
|
|
495
|
+
|
|
496
|
+
# --- Warn early if shapefile requested but geopandas missing ---
|
|
497
|
+
if shapefile and not HAVE_GEO:
|
|
498
|
+
print(
|
|
499
|
+
"[WARN] --shapefile requires geopandas and shapely.\n"
|
|
500
|
+
" Install them with: pip install viewtif[geo]\n"
|
|
501
|
+
" Proceeding without shapefile overlay."
|
|
502
|
+
)
|
|
503
|
+
|
|
504
|
+
run_viewer(
|
|
505
|
+
tif_path,
|
|
506
|
+
scale=scale,
|
|
507
|
+
band=band,
|
|
508
|
+
rgb=rgb,
|
|
509
|
+
rgbfiles=rgbfiles,
|
|
510
|
+
shapefile=shapefile,
|
|
511
|
+
shp_color=shp_color,
|
|
512
|
+
shp_width=shp_width,
|
|
513
|
+
)
|
|
514
|
+
|
|
493
515
|
|
|
494
516
|
if __name__ == "__main__":
|
|
495
517
|
main()
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: viewtif
|
|
3
|
+
Version: 0.1.3
|
|
4
|
+
Summary: Simple GeoTIFF viewer with optional shapefile overlay.
|
|
5
|
+
Project-URL: Homepage, https://github.com/nkeikon/tifviewer
|
|
6
|
+
Project-URL: Source, https://github.com/nkeikon/tifviewer
|
|
7
|
+
Project-URL: Issues, https://github.com/nkeikon/tifviewer/issues
|
|
8
|
+
Author: Keiko Nomura
|
|
9
|
+
License: MIT
|
|
10
|
+
Requires-Python: >=3.9
|
|
11
|
+
Requires-Dist: click>=8.1
|
|
12
|
+
Requires-Dist: matplotlib>=3.7
|
|
13
|
+
Requires-Dist: numpy>=1.23
|
|
14
|
+
Requires-Dist: pyside6>=6.5
|
|
15
|
+
Requires-Dist: rasterio>=1.3
|
|
16
|
+
Provides-Extra: geo
|
|
17
|
+
Requires-Dist: geopandas>=0.13; extra == 'geo'
|
|
18
|
+
Requires-Dist: shapely>=2.0; extra == 'geo'
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
|
|
21
|
+
# viewtif
|
|
22
|
+
|
|
23
|
+
A lightweight GeoTIFF viewer for quick visualization directly from the command line.
|
|
24
|
+
|
|
25
|
+
You can visualize single-band GeoTIFFs, RGB composites, and shapefile overlays in a simple Qt-based window.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pip install viewtif
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Quick Start
|
|
36
|
+
```bash
|
|
37
|
+
# View a GeoTIFF
|
|
38
|
+
viewtif examples/sample_data/ECOSTRESS_LST.tif
|
|
39
|
+
|
|
40
|
+
# View with shapefile overlay
|
|
41
|
+
viewtif examples/sample_data/ECOSTRESS_LST.tif \
|
|
42
|
+
--shapefile examples/sample_data/Zip_Codes.shp
|
|
43
|
+
|
|
44
|
+
# View an RGB composite
|
|
45
|
+
viewtif --rgbfiles \
|
|
46
|
+
examples/sample_data/HLS_B4.tif \
|
|
47
|
+
examples/sample_data/HLS_B3.tif \
|
|
48
|
+
examples/sample_data/HLS_B2.tif
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Controls
|
|
53
|
+
| Key | Action |
|
|
54
|
+
| -------------------- | --------------------------------------- |
|
|
55
|
+
| `+` / `-` | Zoom in / out |
|
|
56
|
+
| Arrow keys or `WASD` | Pan |
|
|
57
|
+
| `C` / `V` | Increase / decrease contrast |
|
|
58
|
+
| `G` / `H` | Increase / decrease gamma |
|
|
59
|
+
| `M` | Toggle colormap (`viridis` ↔ `magma`) |
|
|
60
|
+
| `[` / `]` | Previous / next band (single-band only) |
|
|
61
|
+
| `R` | Reset view |
|
|
62
|
+
|
|
63
|
+
## Features
|
|
64
|
+
- Command-line driven GeoTIFF viewer
|
|
65
|
+
- Supports single-band or RGB composite display.
|
|
66
|
+
- Optional shapefile overlay for geographic context.
|
|
67
|
+
- Adjustable contrast, gamma, and colormap.
|
|
68
|
+
- Fast preview using rasterio and PySide6.
|
|
69
|
+
|
|
70
|
+
## Example Data
|
|
71
|
+
- ECOSTRESS_LST.tif
|
|
72
|
+
- Zip_Codes.shp and associated files
|
|
73
|
+
- HLS_B4.tif, HLS_B3.tif, HLS_B2.tif (RGB sample)
|
|
74
|
+
|
|
75
|
+
## Credit & License
|
|
76
|
+
`viewtif` was inspired by the NASA JPL Thermal Viewer — Semi-Automated Georeferencer (GeoViewer v1.12) developed by Jake Longenecker (University of Miami Rosenstiel School of Marine, Atmospheric & Earth Science) while at the NASA Jet Propulsion Laboratory, California Institute of Technology, with inspiration from JPL’s ECOSTRESS geolocation batch workflow by Andrew Alamillo. The original GeoViewer was released under the MIT License (2025) and may be freely adapted with citation.
|
|
77
|
+
|
|
78
|
+
# Citation
|
|
79
|
+
Longenecker, Jake; Lee, Christine; Hulley, Glynn; Cawse-Nicholson, Kerry; Purkis, Sam; Gleason, Art; Otis, Dan; Galdamez, Illeana; Meiseles, Jacquelyn. GeoViewer v1.12: NASA JPL Thermal Viewer—Semi-Automated Georeferencer User Guide & Reference Manual. Jet Propulsion Laboratory, California Institute of Technology, 2025. PDF.
|
|
80
|
+
|
|
81
|
+
# License
|
|
82
|
+
This project is released under the MIT License.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
viewtif/tif_viewer.py,sha256=MGOSrYYe5rJpJRALTNQIHii8JNb5I8vMlo3Edlb09vA,19891
|
|
2
|
+
viewtif-0.1.3.dist-info/METADATA,sha256=AvnZVyR2afhkfRIyNv4FAAc3i-yLnfdEA__5jck7HGc,3174
|
|
3
|
+
viewtif-0.1.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
4
|
+
viewtif-0.1.3.dist-info/entry_points.txt,sha256=NVEjlRyJ7R7hFPOVsZJio3Hl0VqlX7_oVfA7819XvHM,52
|
|
5
|
+
viewtif-0.1.3.dist-info/RECORD,,
|
viewtif-0.1.1.dist-info/METADATA
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: viewtif
|
|
3
|
-
Version: 0.1.1
|
|
4
|
-
Summary: Simple GeoTIFF viewer with optional shapefile overlay.
|
|
5
|
-
Author: Keiko Nomura
|
|
6
|
-
License: MIT
|
|
7
|
-
Requires-Python: >=3.9
|
|
8
|
-
Requires-Dist: click>=8.1
|
|
9
|
-
Requires-Dist: matplotlib>=3.7
|
|
10
|
-
Requires-Dist: numpy>=1.23
|
|
11
|
-
Requires-Dist: pyside6>=6.5
|
|
12
|
-
Requires-Dist: rasterio>=1.3
|
|
13
|
-
Description-Content-Type: text/markdown
|
|
14
|
-
|
|
15
|
-
# viewtif
|
|
16
|
-
|
|
17
|
-
A simple GeoTIFF viewer with optional shapefile overlay.
|
|
18
|
-
|
|
19
|
-
## Usage
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
viewtif my_raster.tif --shapefile my_overlay.shp
|
|
23
|
-
|
viewtif-0.1.1.dist-info/RECORD
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
viewtif/tif_viewer.py,sha256=hXoL4J0XSJlhoDytXIDc3UiS1mAQ29t5T6YNofrtONo,18933
|
|
2
|
-
viewtif-0.1.1.dist-info/METADATA,sha256=qeGxbVSZ2o3r5XgU1uoMgm6VuL-4YnLmxOTMBkitdjs,491
|
|
3
|
-
viewtif-0.1.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
4
|
-
viewtif-0.1.1.dist-info/entry_points.txt,sha256=NVEjlRyJ7R7hFPOVsZJio3Hl0VqlX7_oVfA7819XvHM,52
|
|
5
|
-
viewtif-0.1.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|