Metadata-Version: 2.4
Name: rasteric
Version: 1.1.1
Summary: A Python geospatial library for raster preprocessing, analysis, visualization, and modeling
Home-page: https://github.com/tnmthai/rasteric
Author: Thai Tran
Author-email: me@tnmthai.com
License: MIT
Project-URL: Bug Tracker, https://github.com/tnmthai/rasteric/issues
Project-URL: repository, https://github.com/tnmthai/rasteric
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: rasterio>=1.0
Requires-Dist: matplotlib>=3.0
Requires-Dist: shapely>=1.7
Requires-Dist: geopandas>=0.9
Requires-Dist: numpy>=1.18
Requires-Dist: pandas>=1.0
Requires-Dist: scikit-learn>=0.24
Requires-Dist: rasterstats
Dynamic: author
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Rasteric

**Rasteric** is a Python geospatial library designed for raster preprocessing, analysis, visualization, and modeling. It simplifies common GIS workflows with easy-to-use functions built on top of Rasterio and GeoPandas.

## Installation

```bash
pip install rasteric
```

Dependencies are installed automatically:

- rasterio
- geopandas
- shapely
- numpy
- pandas
- matplotlib
- scikit-learn
- rasterstats

## Requirements

- **Python** >= 3.8

## Supported Data Formats

- **Raster**: GeoTIFF, TIFF
- **Vector**: Shapefiles, GeoJSON
- **Tabular**: CSV with spatial attributes (latitude/longitude)

## Typical Use Cases

- Satellite image preprocessing (Sentinel-2, Landsat)
- NDVI and vegetation analysis
- Land-use / land-cover mapping
- Agricultural monitoring
- Raster-vector data extraction
- Geospatial machine learning data preparation

## Quick Start

```python
from rasteric import plot, clip, ndvi, stack, extract

# Visualize a raster with RGB bands
plot('sentinel2.tif', bands=(4, 3, 2), brightness_factor=4)

# Clip raster to study area
clip('raster.tif', 'boundary.shp', 'clipped.tif')

# Compute NDVI
ndvi('sentinel2.tif', 'ndvi_output.tif', red_band=3, nir_band=4)

# Stack band files into a single multi-band raster
stack('bands_folder/', 'stacked.tif')

# Extract raster values at vector points
extract('raster.tif', 'points.shp', 'extracted.csv')
```

## Functions

| Function | Description |
|---|---|
| `convpath(file_path)` | Convert backslashes to forward slashes for cross-platform paths |
| `stack(input_folder, output_file)` | Stack multiple rasters into a single multi-band file |
| `mergecsv(path, outfile)` | Merge all CSV files in a directory into one |
| `clip(raster_file, shapefile, output_file)` | Clip a raster using a shapefile geometry |
| `reproject(input_raster, output_raster, target_crs)` | Reproject a raster to a different CRS |
| `resample(input_raster, output_raster, scale_factor)` | Resample raster to a new resolution |
| `ndvi(raster_file, output_file, red_band, nir_band)` | Compute Normalized Difference Vegetation Index |
| `zonalstats(raster_file, vector_file, stats)` | Calculate zonal statistics for vector polygons |
| `stats(raster_file)` | Get basic raster statistics (min, max, mean, std) |
| `extract(input_data, shp, output_csv)` | Extract raster values for vector features or CSV points |
| `align_to_shp(input_tif, source_shp, output_tif)` | Reproject a raster to match a shapefile's CRS |
| `convras(raster_file, output_shapefile)` | Convert raster to vector polygons |
| `plot(file, bands, cmap, title, ax, brightness_factor)` | Display a raster with band selection and brightness control |
| `contour(file)` | Overlay contour lines on a raster image |
| `hist(file, bin, title)` | Plot a histogram of raster pixel values |
| `bandnames(input_raster, band_names)` | Update band descriptions in a raster file |
| `haversine(lon1, lat1, lon2, lat2)` | Calculate great-circle distance between two points |

## Contributing

We welcome contributions and issue reports!

- **Repository**: [github.com/tnmthai/rasteric](https://github.com/tnmthai/rasteric)
- **Issues**: [github.com/tnmthai/rasteric/issues](https://github.com/tnmthai/rasteric/issues)
- **PyPI**: [pypi.org/project/rasteric](https://pypi.org/project/rasteric/)

Please submit pull requests or report bugs via GitHub.

## License

MIT License
