I am trying to import a raster file that contains land-cover codes. Once the raster sets the patch variables to these land-cover codes, I want to link those codes to a separate .csv that has vegetation-specific parameters for each land-cover code. Thus each patch will be assigned the .csv variables based on its land-cover code. I'm completely stumped as to how to do this. More generally, how can I use a .csv as a cross-reference file? I don't have any code examples but here is an example of the kind of .csv I want to use: Table example
So this .csv would assign the GR1 variables to multiple patches with land-cover code GR1
I agree with JenB for sure, especially if your values table is relatively short. However, if you have a lot of values, it might work to use the
csv
andtable
extensions together to make a dictionary where the 'land-cover code' acts as the key to retrieve the other data for your patch. So one path would be:So with this example csv table:
And these extensions and variables:
We can run a code block to do all these steps (more explanation in comments):
This generates a toy landscape where each patch is assigned a
fuel
andpatchType
value according to a query based on the first column of that csv:Hopefully that gets you started