Skip to main content

A Python geospatial library for raster preprocessing, analysis, visualization, and modeling

Project description

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

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

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!

Please submit pull requests or report bugs via GitHub.

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rasteric-1.1.1.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rasteric-1.1.1-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file rasteric-1.1.1.tar.gz.

File metadata

  • Download URL: rasteric-1.1.1.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for rasteric-1.1.1.tar.gz
Algorithm Hash digest
SHA256 cd4385e6d3ceaf9b5b46ca9b0cb8a361f6c2f8a25d227445d8728eb96d165cf7
MD5 b99a878b1b3facd4927f4f67102fabc9
BLAKE2b-256 9d58f8dc300a37f5c79279bd05f673cfad91e11c6500b1aa670490530bfd489c

See more details on using hashes here.

File details

Details for the file rasteric-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: rasteric-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 17.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for rasteric-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6e826efe1170fb380015746e503f4f3d69ef3ddbb9ddd562f558c79d57889e9f
MD5 9718b937d6c29dfd8cae1cfda9c8d86c
BLAKE2b-256 9ef58a200efb44a6bca795b5c05e9f3615df11ab0a1aac8904e24bc175c6f629

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page