A Comprehensive Geospatial Library
Project description
Rasteric: A Comprehensive Geospatial Library
Rasteric is a comprehensive library for geospatial data preprocessing, analysis, and modeling. It provides a variety of functions for transforming, analyzing, and manipulating geospatial data, including raster and vector data.
Supported Data Formats
Rasteric supports multiple geospatial data formats, including:
- Raster data: GeoTIFF, TIFF
- Vector data: Shapefiles, GeoJSON
- Tabular data: CSV files with spatial attributes (e.g., latitude and longitude)
Key Features and Functions
Data Handling
convpath(): Standardizes file paths for cross-platform compatibility.stack(): Combines multiple raster files into a single multi-band raster.mergecsv(): Combines multiple CSV files into a single CSV.
Data Analysis
zonalstats(): Computes zonal statistics for vector polygons based on raster values.stats(): Provides basic raster statistics (min, max, mean, std).ndvi(): Computes the Normalized Difference Vegetation Index.
Data Manipulation
clip(): Clips a raster using a vector file.reproject(): Reprojects rasters to a specified coordinate reference system.resample(): Changes raster resolution using a specified scaling factor.
Data Visualization
plot(): Displays a raster with customizable brightness and band selection.contour(): Overlays contour lines on a raster image.hist(): Plots a histogram of raster values.
Raster to Vector Conversion
convras(): Converts a raster file to vector polygons.
Extraction and Integration
extract(): Extracts raster values for vector features or CSV spatial points.align_to_shp(): Aligns a raster's CRS to match a shapefile's CRS.
Example Usage
Visualizing a Raster
from rasteric import raster
from matplotlib import pyplot
# Plot raster bands with brightness adjustment
raster.plot('example.tif', bands=(3, 2, 1), title="Example Raster")
Stacking Multiple Rasters
from rasteric import raster
# Stack rasters into a single file
stacked_file = raster.stack("data_folder", "stacked_output.tif")
Extracting Data
from rasteric import raster
# Extract raster values for vector features
output_csv = raster.extract("example.tif", "vector.shp")
Computing NDVI
from rasteric import raster
# Calculate NDVI and save the result
ndvi_output = raster.ndvi("example.tif", "ndvi_output.tif", red_band=3, nir_band=4)
Function Descriptions
-
convpath(file_path) Description: Converts a file path to a cross-platform compatible format.
-
stack(input_folder, output_file) Description: Stacks multiple rasters into a single file with multi-band output.
-
mergecsv(path, outfile='combined.csv') Description: Merges all CSV files in a directory into one.
-
clip(raster_file, shapefile, output_file) Description: Clips a raster using a shapefile's geometry.
-
zonalstats(raster_file, vector_file, stats=['mean', 'max']) Description: Calculates statistics for vector polygons over raster values.
-
ndvi(raster_file, output_file, red_band, nir_band) Description: Computes the Normalized Difference Vegetation Index.
-
resample(input_raster, output_raster, scale_factor, resampling_method) Description: Resamples a raster to a new resolution.
-
extract(input_data, shp, output_csv, all_touched=False) Description: Extracts raster values for vector features or CSV points.
-
plot(file, bands, cmap, title, ax, brightness_factor) Description: Plots raster data with band selection and brightness control.
-
align_to_shp(input_tif, source_shp, output_tif) Description: Reprojects a raster to align its CRS with a shapefile.
Contributions and Issues
We welcome contributions and issue reports! Please submit pull requests or report bugs via the GitHub repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rasteric-1.0.1.tar.gz.
File metadata
- Download URL: rasteric-1.0.1.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
766ec4264b8e3701dcbd70730706ca90b66668b2efdba1ee4393464ab250707e
|
|
| MD5 |
04afa8a4d1d2126ffe0f06c9abadf341
|
|
| BLAKE2b-256 |
36fb71fd439dbfd1288b91cddf2c4dbe73639954bbf5bee57ecef48530d87a1f
|
File details
Details for the file rasteric-1.0.1-py3-none-any.whl.
File metadata
- Download URL: rasteric-1.0.1-py3-none-any.whl
- Upload date:
- Size: 17.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74ca94deb2a76c937715809a787e855c65959b3a666f27b9b1dbf4ef0202e406
|
|
| MD5 |
9510e5f19f77833b091667683edd1879
|
|
| BLAKE2b-256 |
1f89183d6f952b972582e6eb528d40c828cc6b949b1310d87fffd47d82db0e29
|