sample_extraction

museotoolbox.processing.sample_extraction(in_image, in_vector, out_vector, unique_fid=None, band_prefix=None, verbose=1)[source]

Extract centroid from shapefile according to the raster, and extract band value if band_prefix is given.

This script is available via terminal by entering : mtb_SampleExtraction.

Parameters
  • in_image (str.) – A filename or path of a raster file. It could be any file that GDAL can open.

  • in_vector (str.) – A filename or path corresponding to a vector file. It could be any file that GDAL/OGR can open.

  • out_vector (str.) – Extension will be used to select driver. Please use one of them : [‘gpkg’,’sqlite’,’shp’,’netcdf’,’gpx’].

  • unique_fid (str, optional (default=None)) – If None, will add a field called ‘uniquefid’ in the output vector.

  • band_prefix (str, optional (default=None)) – If band_prefix (e.g. ‘band’), will extract values from raster.