viewtif 0.1.1__tar.gz → 0.1.3__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.
@@ -0,0 +1,4 @@
1
+ .venv/
2
+ dist/
3
+ __pycache__/
4
+ *.pyc
viewtif-0.1.3/PKG-INFO ADDED
@@ -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,62 @@
1
+ # viewtif
2
+
3
+ A lightweight GeoTIFF viewer for quick visualization directly from the command line.
4
+
5
+ You can visualize single-band GeoTIFFs, RGB composites, and shapefile overlays in a simple Qt-based window.
6
+
7
+ ---
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ pip install viewtif
13
+ ```
14
+
15
+ ## Quick Start
16
+ ```bash
17
+ # View a GeoTIFF
18
+ viewtif examples/sample_data/ECOSTRESS_LST.tif
19
+
20
+ # View with shapefile overlay
21
+ viewtif examples/sample_data/ECOSTRESS_LST.tif \
22
+ --shapefile examples/sample_data/Zip_Codes.shp
23
+
24
+ # View an RGB composite
25
+ viewtif --rgbfiles \
26
+ examples/sample_data/HLS_B4.tif \
27
+ examples/sample_data/HLS_B3.tif \
28
+ examples/sample_data/HLS_B2.tif
29
+
30
+ ```
31
+
32
+ ## Controls
33
+ | Key | Action |
34
+ | -------------------- | --------------------------------------- |
35
+ | `+` / `-` | Zoom in / out |
36
+ | Arrow keys or `WASD` | Pan |
37
+ | `C` / `V` | Increase / decrease contrast |
38
+ | `G` / `H` | Increase / decrease gamma |
39
+ | `M` | Toggle colormap (`viridis` ↔ `magma`) |
40
+ | `[` / `]` | Previous / next band (single-band only) |
41
+ | `R` | Reset view |
42
+
43
+ ## Features
44
+ - Command-line driven GeoTIFF viewer
45
+ - Supports single-band or RGB composite display.
46
+ - Optional shapefile overlay for geographic context.
47
+ - Adjustable contrast, gamma, and colormap.
48
+ - Fast preview using rasterio and PySide6.
49
+
50
+ ## Example Data
51
+ - ECOSTRESS_LST.tif
52
+ - Zip_Codes.shp and associated files
53
+ - HLS_B4.tif, HLS_B3.tif, HLS_B2.tif (RGB sample)
54
+
55
+ ## Credit & License
56
+ `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.
57
+
58
+ # Citation
59
+ 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.
60
+
61
+ # License
62
+ This project is released under the MIT License.
@@ -0,0 +1,24 @@
1
+ # Examples
2
+
3
+ This folder contains small demo data to test **viewtif**.
4
+
5
+ ## Quick test
6
+ After installing viewtif, run:
7
+
8
+ ```bash
9
+ viewtif examples/sample_data/ECOSTRESS_LST.tif
10
+ viewtif examples/sample_data/ECOSTRESS_LST.tif --shapefile examples/Zip_Codes.shp
11
+ viewtif --rgbfiles examples/sample_data/HLS_B4.tif examples/sample_data/HLS_B3.tif examples/sample_data/HLS_B2.tif
12
+ ```
13
+
14
+ Controls
15
+ | Key | Action | Mode |
16
+ | ----------------------------- | ------------------------------------- | ----------- |
17
+ | `+` / `-` | Zoom in / out | All |
18
+ | Arrow keys or `W` `A` `S` `D` | Pan | All |
19
+ | `C` / `V` | Decrease / increase contrast | All |
20
+ | `G` / `H` | Decrease / increase gamma | All |
21
+ | `M` | Toggle colormap (`viridis` ↔ `magma`) | Single-band |
22
+ | `[` / `]` | Previous / next band | Single-band |
23
+ | `R` | Reset view | All |
24
+
@@ -0,0 +1 @@
1
+ UTF-8
@@ -0,0 +1 @@
1
+ PROJCS["NAD_1983_StatePlane_California_II_FIPS_0402_Feet",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",6561666.666666666],PARAMETER["False_Northing",1640416.666666667],PARAMETER["Central_Meridian",-122.0],PARAMETER["Standard_Parallel_1",38.33333333333334],PARAMETER["Standard_Parallel_2",39.83333333333334],PARAMETER["Latitude_Of_Origin",37.66666666666666],UNIT["Foot_US",0.3048006096012192]]
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "viewtif"
7
- version = "0.1.1"
7
+ version = "0.1.3"
8
8
  description = "Simple GeoTIFF viewer with optional shapefile overlay."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -18,9 +18,17 @@ dependencies = [
18
18
  "PySide6>=6.5"
19
19
  ]
20
20
 
21
+ [project.optional-dependencies]
22
+ geo = ["geopandas>=0.13", "shapely>=2.0"]
23
+
21
24
  [project.scripts]
22
25
  viewtif = "viewtif.tif_viewer:main"
23
26
 
27
+ [project.urls]
28
+ "Homepage" = "https://github.com/nkeikon/tifviewer"
29
+ "Source" = "https://github.com/nkeikon/tifviewer"
30
+ "Issues" = "https://github.com/nkeikon/tifviewer/issues"
31
+
24
32
  [tool.hatch.build.targets.wheel]
25
33
  packages = ["src/viewtif"]
26
34
 
@@ -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 = "cyan",
78
- shp_width: float = 1.5,
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", type=click.Path(exists=True))
486
- @click.option("--shapefile", type=click.Path(exists=True), default=None,
487
- help="Optional shapefile overlay")
488
- @click.option("--scale", type=float, default=None, help="Optional scale")
489
- @click.option("--band", type=int, default=None, help="Optional band index")
490
- def main(tif_path, shapefile, scale, band):
491
- """CLI entry point for viewtif"""
492
- run_viewer(tif_path, scale=scale, band=band, shapefile=shapefile)
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()
viewtif-0.1.1/PKG-INFO 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/README.md DELETED
@@ -1,9 +0,0 @@
1
- # viewtif
2
-
3
- A simple GeoTIFF viewer with optional shapefile overlay.
4
-
5
- ## Usage
6
-
7
- ```bash
8
- viewtif my_raster.tif --shapefile my_overlay.shp
9
-