iucm preproc mask¶
Mask grid cells based on a shape file
This command calculates the maximum population for the model based on a masking shape file. The given shape file is rasterized at high resolution (by default, 100 times the resolution of the input file) and the fraction for each grid cell that is covered by that shape file is calculated.
usage: iucm preproc mask [-h] [-m {'max-pop', 'mask', 'ignore'}] [-i str]
[-v str] [-overwrite] [-max float] [-r int]
str
Positional Arguments¶
str | The path to a shapefile |
Named Arguments¶
-m, --method | Default: “max-pop”. Determines how to handle the given shapes.
Default: “max-pop” |
-i, --ifile | The path of the input file. If not specified, the value of the configuration is used |
-v, --vname | The variable name to use. If not specified and only one variable
exists in the dataset, this one is used. Otherwise, the
'run.vname' key in the experiment configuration is used |
-overwrite | If True and the target variable exists already in the input file ifile (and method is not ‘ignore’), this variable is overwritten Default: False |
-max, --max-pop | |
The maximum population. If not specified, the value in the
configuration is used (only necessary if method=='max-pop' ) | |
-r, --hr-res | The resolution of the high resolution file, relative to the
resolution of ifile (only necessary if Default: 100 |
Notes
Note that the shapefile and the input file have to be defined on the same coordinate system! This function is not super efficient, for large data files we recommend using gdal_rasterize and gdalwarp.