Profile

Join date: May 18, 2022

About
0 Like Received
0 Comment Received
0 Best Answer




 

Copy.Kitty.v3.1.1-SiMPLEX Download


Download


 





Copy.Kitty.v3.1.1-SiMPLEX download -...Q: Split raster into multiple files based on a field I have a raster with three fields: feature (1) field, ID (1) field and cell value (1) field. I want to split the raster in a list of ncdf-files based on feature. The number of features (or ncdf files) varies and I want to write each ncdf-file into a different file. I know how to split a ncdf-file into a list of ncdf-files, but I don't know how to filter the features by ID to create the list. A: For what you want you could use the nc_populate tool from the pyRasterIO package. From the description of this tool: nc_populate reads an existing raster (nc or netcdf) as input, and creates a new raster output as output, with a new data type for each input grid cell which has a different value for all the different features. It will split your raster into files with the name of the raster, the ID of the feature and a number (using the prefix 'id' which you can change if you want) For example: #Check if raster file exists if 'rasters' in os.listdir(path): #rasters is a directory if os.path.isfile(path+' asters'+raster): #rasters is a file print('exists') #check that the file is one of the raster files you need to read raster_filenames=os.listdir(path+' asters') for raster in raster_filenames: if os.path.isfile(path+' asters'+raster+'.nc'):




ee43de4aa9

Copy.Kitty.v3.1.1-SiMPLEX Download

More actions