Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

How to prepare the tiff file for gdal to generate the land cover binary files?

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.

Chang_Shu

New member
Hello, WRF team
We are doing WRF simulations for several Canadian Cities like Ottawa, Montreal
We are trying to update the urban land use land cover by extracting the urban pixels from a tif file for the input of WRF.
I have noticed that in the WRF manual, it has mentioned to use the GDAL tool to translate the tiff file to binary files using the command:
> gdal_translate -of ENVI foo.tif data.bil

However, the tif file we have is for the whole Canada, which is quite big (160001 rows*190001 cols).
The coordinate projections in the tif file is:
+proj=lcc +lat_1=49 +lat_2=77 +lat_0=49 +lon_0=-95 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs
While I know the projection in the binary files should be regular_ll, which, according to http://www.met.wur.nl/Summerinthecity/posts/2014/03/wrfgisinput/
, should be postgis SRID 4326.

My question is how can I convert this tif file for whole Canada to the required binary format for the input of WRF?
[*]How should I make the projections in tif file consistent with the regular_ll projection or gdal can transform it automatically?
[*]Should I crop the tiff file to make sure the number of rows and cols limited in 5 digits?
As is mentioned in the manual:
After converting the GeoTIFF to a binary file, the resulting data.bil file must be renamed to 00001-ncols.00001-nrows, where ncols is the number of columns (in i5.5 format) and nrows is the number of rows (also in i5.5 format) in the image; these values should have been printed to the screen when the gdal_translate program was run.
[*]How should I change the values in the tiff file for different types of land use land cover types? should it be consistent with the default lulc values in WRF?
[*]Another question is that how can I open and view the existing binary files in WRF so that I can understand the necessary information required in the orginal tiff file?

Thanks,
Chang
 
It is possible to provide datasets on projections other than the cylindrical equidistant ("regular lat-lon") projection. The Lambert conformal conic projection is among the map projections that are supported by the geogrid program, so you shouldn't need to reproject your dataset. You can consult the list of available keywords for 'index' files in Chapter 3 of the ARW Users's Guide. For datasets on a Lambert conformal projection, you'll need to specify: projection, dx, dy, stdlon, truelat1, and truelat2.

The current release of the WPS actually supports filenames with six digits. You'll only need to add the filename_digits keyword (as describe in the Users's Guide section linked above) to your 'index' file. It does appear, though, that there are still a few places where we need to update our documentation.

If your intent is to make use of all land use categories in your dataset, rather than just the urban categories, you'll need to remap each of your categories to the categories defined in the VEGPARM.TBL file for a particular classification scheme (e.g., USGS, MODIFIED_IGBP_MODIS_NOAH, NLCD40). Alternatively, you could define a new classification scheme in the VEGPARM.TBL, with entries describing each of the categories in your land cover dataset. On the other hand, if you only intent to make use of the urban categories in your dataset, you can just set all non-urban pixels to some missing category (for example, zero) and remap the urban categories to 31, 32, and 33.

The existing binary files contain only integer values representing the (possibly scaled) values of each pixel in the raster of data; information about the projection, resolution, and geographical location of the dataset is all contained in the 'index' file that accompanies the binary data. If you haven't already done so, it might be helpful to go through the Advanced Features of the WPS slides.
 
Hello, Mr. Duda
Thanks for your detailed reply.
I will first remap the numbers in my tiff file then convert it to binary directly without cropping and coordination projections. Then let you know if it works.

One thing is still kind of confusing for me is the category in the VEGPARM.TBL.
For example the MODIFIED_IGBP_MODIS_NOAH classification scheme, I can find in the list there is number 13 for urban and built-up.
While after the list there is also (as you have mentioned):
LOW_DENSITY_RESIDENTIAL
31
HIGH_DENSITY_RESIDENTIAL
32
HIGH_INTENSITY_INDUSTRIAL
33

Does it mean if I know the categories of the urban pixels (LOW_DENSITY_RESIDENTIAL, HIGH_DENSITY_RESIDENTIAL, HIGH_INTENSITY_INDUSTRIAL), I should use these 3 numbers (31, 32, 33).
Otherwise I should remap the urban pixels to 13?
And I found for the index file there is an item for "isurban".
Should I change this one according to the two methods I remap the tiff file:
For the former method "isurban = 31,32,33", while the latter "isurban = 13"?

And I was also acknowledged that there is another way of defining the urban model with heterogeneous urban land covers, which may distinguish the portion of road, wall, and roof. Would you please suggest a little bit on the required land cover file for this type of modelling and where can I find instructions to run this type of urban model.

Thanks in advance,

Chang Shu
 
Hello, Duda
I have tried to remap the tiff file to have assigned 13 to all the urban pixels, while changing all the others to 0.
Then converted the tiff file to .bil using the command
> gdal_translate -of ENVI foo.tif data.bil
Then I changed the filename to the number of rows and cols following the instruction in the manual.
I developed the index file and added a new entry for LANDUSEF in the GEOGRID.TBL.CAN.

After these steps the geogrid.exe can be run successfully.
I therefore checked the LU_INDEX variable in the geo_em files to compare with the old ones.
But the land cover (LU_INDEX) distribution seems the same between the default and the updated land cover.

I am not sure where is wrong and how I can proceed correctly.
Please find the attached View attachment index.txt and View attachment GEOGRID.TBL.CAN.txt files.
Thanks,

Chang
 
Top