Skip to content

ricardog/rasterset

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rasterset

Python library to perform calculations on sets of raster maps as if they were one. Each raster map is either read from disk, or computed using "simple" expressions. The library takes care to find the minimal intersection of the input rasters.

The library tries to be efficient about the calculations and will, when possible, iterate through block windows.

Uses rasterio to perform IO/

Example

from rasterset import RasterSet, Raster, SimpleExpr

rs = RasterSet({
	'a': Raster('/path/to/raster/a.tif'),
	'b': Raster('/path/to/raster/a.tif'),
	'two': SimpleExpr(2)
	'c': SimpleExpr('(a + log(b + 1)) * two)})

# To evaluate the whole raster
data, meta = rs.eval('c')
with rasterio.open('output.tif', 'w', **meta) as dst:
    dst.write(data, indexes=1)

# Or, to process a block at a time.  Can use multiple processes to
# process multiple blocks in parallel.
rs.write('c', 'output.tif')

About

Python library to operate on sets of rasters

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages