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

segmentation fault while converting geotiff files to binary using convert_geotiff

SSR

New member
Hello WRF team. I am pretty new to WRF modelling and I'm trying to update DEM data in the wrf model. I am using SRTM 30m data. I have a single large .tif file that covers my model domain and I am trying to convert it using the "convert_geotiff" module (GitHub - openwfm/convert_geotiff: A commandline utility for converting GeoTIFF files for use in WRF). It specifies that the grid points must be less than 99999 on each axis and the file I am trying to convert is approx. 97000*72000 grid points which is well under the maximum limit. But when I run the command "convert_geotiff -b 3 -w 2 -t 100 -s 1 -m -9999 -u "meters" -d "SRTM 30m" SRTM.tif" it gives "segmentaton fault (core dumped)". please help me in this regard.
I want to know how to fix this error and what i am doing wrong?
Also if there is any alternative way to convert geotiff files to binary?
I also could not understand the point that some other users have mentioned, that you can convert files in smaller parts by placing them in subdirectories and then use in wps. How is this possible? the geogrid expects all the binary files in single directory as far as I know. separately converting files will generate multiple subdirectories and index files.
 
about the conversion:
QGIS with the GIS4WRF plugin works magic for the conversion.

Here are some instructions: Convert spatial data to WRF Pre-Processing System (WPS) - Pratiman Homepage

In the gis4wrf plugin, you might need to do some tinkering with the bootstrap.py file installed in the qgis-plugin set dir.
In the attached pictures you can see the error when activating the plugin, and how it should be fixed for py39 or newer.
(this I've tested in QGIS+GIS4WRF in Windows+Linux)

After fixing that, it will work.
 

Attachments

  • notes-gis4wrf.JPG
    notes-gis4wrf.JPG
    229.4 KB · Views: 7
  • notes-gis4wrf-2.JPG
    notes-gis4wrf-2.JPG
    40.7 KB · Views: 6
Thanks for the reply.
As I was looking for alternatives, I also discovered the GIS4WRF module in QGIS last week as a potential way of converting geotiff files to binary format. I am currently using version 3.40 of QGIS and I also had the similar issue while installing plugin, but I managed to resolve it. As you mentioned it does work magic for this job and the conversion is seamless and fast.
Currently my only issue is the orientation of the binary files generated from QGIS. I compared the tiles obtained from QGIS and convert_geotiff module to check whether the conversion was successful. The elevation data is correct but the orientation of data is flipped by 180 degrees. QGIS is giving "top_bottom" orientation while convert_geotiff is giving "bottom_top" (which is standard for WRF). I dont know how to change this within QGIS as there is no control setting I could find in QGIS. Can you suggest any possible solution to this issue. Did you face the same issue when you used this module?

I have attached few images for reference!!
 

Attachments

  • 03001-06000.12001-15000.jpg
    03001-06000.12001-15000.jpg
    62.3 KB · Views: 4
  • 06001-09000.03001-06000.jpg
    06001-09000.03001-06000.jpg
    88.8 KB · Views: 5
  • Screenshot 2025-07-10 073652.png
    Screenshot 2025-07-10 073652.png
    11.6 KB · Views: 5
  • Screenshot 2025-07-10 073557.png
    Screenshot 2025-07-10 073557.png
    14 KB · Views: 5
Wow, thank you for that insight.

I just used the output as it came; I guess that if it is properly defined in the index file, it shouldn't matter, since WPS would interpret the data correctly.
Although, that should be confirmed by others, I think.
In the case for Antarctica that I applied the conversion for REMAv2, the simulations worked just fine.

I found this pdf: https://dtcenter.org/sites/default/...rf/docs/scientific_documents/WRF-NMM_2017.pdf , page 52 (2-45), where it specifies (26. ROW_ORDER) that top_bottom is the USGS data-set default order.

So I guess WPS will work with the index file specification.
 
Good to know that it worked.
I thought the data would not work. I am currently running the WRF model in the default configuration only and trying to update the topography data. I will also try to run some test case and see if this data works. I will update on the progress.
Thank you for the quick response and the link to pdf. I'll give it a read.
 
Top