scarplet.dem module

Classes for loading digital elevation models as numeric grids

class scarplet.dem.BaseSpatialGrid(filename=None)[source]

Bases: scarplet.dem.GDALMixin

Base class for spatial grid

Methods

dtype
is_contiguous(grid) Returns true if grids are contiguous or overlap
load(filename) Load grid from file
merge(grid) Merge this grid with another BaseSpatialGrid.
plot(**kwargs) Plot grid data
save(filename) Save grid as georeferenced TIFF
dtype = <MagicMock name='mock.GDT_Float32' id='140706965038080'>
is_contiguous(grid)[source]

Returns true if grids are contiguous or overlap

Parameters:
grid : BaseSpatialGrid
load(filename)[source]

Load grid from file

merge(grid)[source]

Merge this grid with another BaseSpatialGrid.

Wrapper argound gdal_merge.py.

Parameters:
grid : BaseSpatialGrid
Returns:
merged_grid : BaseSpatialGrid
plot(**kwargs)[source]

Plot grid data

Keyword args:
Any valid keyword argument for matplotlib.pyplot.imshow
save(filename)[source]

Save grid as georeferenced TIFF

class scarplet.dem.CalculationMixin[source]

Bases: object

Mix-in class for grid calculations

class scarplet.dem.DEMGrid(filename=None)[source]

Bases: scarplet.dem.CalculationMixin, scarplet.dem.BaseSpatialGrid

Class representing grid of elevation values

Methods

dtype
is_contiguous(grid) Returns true if grids are contiguous or overlap
load(filename) Load grid from file
merge(grid) Merge this grid with another BaseSpatialGrid.
plot([color]) Plot grid data
save(filename) Save grid as georeferenced TIFF
plot(color=True, **kwargs)[source]

Plot grid data

Keyword args:
Any valid keyword argument for matplotlib.pyplot.imshow
class scarplet.dem.GDALMixin[source]

Bases: object

class scarplet.dem.GeorefInfo[source]

Bases: object

class scarplet.dem.Hillshade(dem)[source]

Bases: scarplet.dem.BaseSpatialGrid

Class representing hillshade of DEM

Methods

dtype
is_contiguous(grid) Returns true if grids are contiguous or overlap
load(filename) Load grid from file
merge(grid) Merge this grid with another BaseSpatialGrid.
plot([az, elev]) Plot hillshade
save(filename) Save grid as georeferenced TIFF
plot(az=315, elev=45)[source]

Plot hillshade