Metadata-Version: 2.4
Name: glidergun
Version: 0.9.185
Summary: Map Algebra with NumPy
License-Expression: MIT
Project-URL: Homepage, https://github.com/jshirota/glidergun
Project-URL: Bug Tracker, https://github.com/jshirota/glidergun/issues
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: contourpy>=1.3.3; python_version >= "3.11"
Requires-Dist: ipython>=8.0
Requires-Dist: kornia>=0.8.2
Requires-Dist: matplotlib>=3.8
Requires-Dist: numpy>=1.26
Requires-Dist: opencv-python>=4.8
Requires-Dist: planetary-computer>=1.0.0
Requires-Dist: rasterio>=1.3.9
Requires-Dist: scikit-learn>=1.3
Requires-Dist: scipy>=1.11
Requires-Dist: shapely>=2.0
Requires-Dist: torch>=2.5
Requires-Dist: torchvision>=0.20
Requires-Dist: sam-prompt>=0.1.2
Dynamic: license-file

# Map Algebra with NumPy

Inspired by the ARC/INFO GRID implementation of [Map Algebra](https://en.m.wikipedia.org/wiki/Map_algebra).

## Basic Usage

```bash
pip install glidergun
```

### Example:

```python
from glidergun import grid

dem = grid("cop-dem-glo-90", (137.8, 34.5, 141.1, 36.8))
hillshade = dem.hillshade()

dem.save("dem.tif")
hillshade.save("hillshade.tif", "uint8")
```

## With Segment Anything Model (larger dependency download)

### CPU-only:

```bash
pip install glidergun[torch]
```

### GPU (NVIDIA CUDA):

Python 3.14:
```bash
pip install --index-url https://download.pytorch.org/whl/cu126 torch torchvision
pip install glidergun[torch]
```

Python 3.10 ~ 3.13:
```bash
pip install --index-url https://download.pytorch.org/whl/cu124 torch torchvision
pip install glidergun[torch]
```

### Example:

```python
from glidergun import stack

bing = stack("microsoft", (-123.164, 49.272, -123.162, 49.273), max_tiles=100)
bing.save("vancouver.tif")

sam = bing.sam("tree", "house", "car")
sam.to_geojson().save("vancouver.json")
```

## ArcGIS

```
"%LOCALAPPDATA%\ESRI\conda\envs\arcgispro-py3-clone\python.exe" -m pip uninstall -y glidergun torch torchvision
"%LOCALAPPDATA%\ESRI\conda\envs\arcgispro-py3-clone\python.exe" -m pip install --index-url https://download.pytorch.org/whl/cu124 torch torchvision
"%LOCALAPPDATA%\ESRI\conda\envs\arcgispro-py3-clone\python.exe" -m pip install glidergun[torch]

```

## QGIS

```
"C:\Program Files\QGIS 3.44.10\apps\Python312\python.exe" -m pip uninstall -y glidergun torch torchvision
"C:\Program Files\QGIS 3.44.10\apps\Python312\python.exe" -m pip install --index-url https://download.pytorch.org/whl/cu124 torch torchvision
"C:\Program Files\QGIS 3.44.10\apps\Python312\python.exe" -m pip install glidergun[torch]
```
