Environmental Correlation API

class pycoal.environment.EnvironmentalCorrelation[source]
__init__()[source]

Construct a new EnvironmentalCorrelation object.

__weakref__

list of weak references to the object (if defined)

create_empty_copy(source_filename, destination_filename)[source]

Create an empty copy of a COAL classified image with the same size.

Parameters:
  • source_filename (str) – filename of the source image
  • destination_filename (str) – filename of the destination image
intersect_proximity(mining_filename, vector_filename, proximity, correlated_filename)[source]

Generate an environmental correlation image containing pixels from the mining classified image detected within a given distance of features within a vector layer.

Parameters:
  • mining_filename (str) – filename of the mining classified image
  • vector_filename (str) – filename of vector layer
  • proximity (float) – distance in meters
  • correlated_filename (str) – filename of the correlated image
proximity(feature_filename, proximity_filename)[source]

Generate a proximity map from the features. N.B. it is essential to have GDAL’s gdal_proximity.py available somewhere on the path. If running Mac OSX, this function will scan /Library/Frameworks/GDAL.framework/.../gdal_proximity.py (which is where the binary package installer installs it to) to locate the file.

Parameters:
  • feature_filename (str) – filename of the feature image
  • proximity_filename (str) – filename of the proximity image
rasterize(vector_filename, feature_filename)[source]

Burn features from a vector image onto a raster image.

Parameters:
  • vector_filename (str) – filename of the vector image
  • feature_filename (str) – filename of the raster image