Metadata-Version: 2.4
Name: glidergun
Version: 0.9.69
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: ipython>=8.38.0
Requires-Dist: matplotlib>=3.10.8
Requires-Dist: numpy>=1.26.4
Requires-Dist: opencv-python>=4.13.0.92
Requires-Dist: planetary-computer>=1.0.0
Requires-Dist: rasterio>=1.4.4
Requires-Dist: scikit-learn>=1.7.2
Requires-Dist: scipy>=1.15.3
Requires-Dist: shapely>=2.1.2
Requires-Dist: typing-extensions>=4.0; python_version < "3.11"
Provides-Extra: torch
Requires-Dist: kornia>=0.8.2; extra == "torch"
Requires-Dist: sam-prompt>=0.1.0; extra == "torch"
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
```

```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")

hillshade
```

![DEM](https://raw.githubusercontent.com/jshirota/glidergun/main/dem.png)

### With Segment Anything Model (larger dependency download)

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

```python
from glidergun import stack

url = "https://t.ssl.ak.tiles.virtualearth.net/tiles/a{q}.jpeg?g=15437"
bing = stack(url, (-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")
```

![QGIS](https://raw.githubusercontent.com/jshirota/glidergun/main/qgis.png)

<a href="https://github.com/jshirota/glidergun/blob/main/glidergun.ipynb" style="font-size:16px;">More Examples</a>

### License

This project is licensed under the MIT License.  See `LICENSE` for details.
