def get_nlcd_mask(nlcd_ds, filter='<STR_LIT>', out_fn=None):
print("<STR_LIT>")<EOL>b = nlcd_ds.GetRasterBand(<NUM_LIT:1>)<EOL>l = b.ReadAsArray()<EOL>print("<STR_LIT>" % filter)<EOL>if filter == '<STR_LIT>':<EOL><INDENT>mask = (l==<NUM_LIT>)<EOL><DEDENT>elif filter == '<STR_LIT>':<EOL><INDENT>mask = np.logical_or((l==<NUM_LIT>),(l==<NUM_LIT:12>))<EOL><DEDENT>elif filter == '<STR_LIT>':<EOL><INDENT>mask = np.logical_or(np.logical_or((l==<NUM_LIT>),(l==<NUM_LIT:12>)),(l==<NUM_LIT:11>))<EOL><DEDENT>elif filter == '<STR_LIT>':<EOL><INDENT>mask = ~(np.logical_or(np.logical_or((l==<NUM_LIT>),(l==<NUM_LIT>)),(l==<NUM_LIT>)))<EOL><DEDENT>elif filter == '<STR_LIT>':<EOL><INDENT>mask = ~(np.logical_or(np.logical_or(np.logical_or((l==<NUM_LIT>),(l==<NUM_LIT>)),(l==<NUM_LIT>)),(l==<NUM_LIT:11>)))<EOL><DEDENT>else:<EOL><INDENT>print("<STR_LIT>")<EOL>mask = None<EOL><DEDENT>if out_fn is not None:<EOL><INDENT>print("<STR_LIT>" % out_fn)<EOL>iolib.writeGTiff(l, out_fn, nlcd_ds)<EOL><DEDENT>l = None<EOL>return mask<EOL>
Generate raster mask for specified NLCD LULC filter