Welcome, Guest
Username: Password: Remember me

TOPIC: Converting selafin file to raster files

Converting selafin file to raster files 1 year 9 months ago #40736

  • R.Wei
  • R.Wei's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 33
  • Thank you received: 7
Hi everyone,

I want to convert selafin file to a list of raster files via batch operations, yet no proper solutions were found.

Some circuitous methods were tried but not so ideal especially for a result file with hundreds of records:
1. Posttelemac in QGIS can export selafin file as raster file manually at each record.
2. Drag slf file into QGIS and manually export a bunch of shape files, then convert shape files to raster files through batch operations.

In terms of the 2nd solution, any chance that anyone may know the command of GDAL converting selafin file to shape files?
Any suggestions would be more than welcomed.

Regards,
Wei
The administrator has disabled public write access.

Converting selafin file to raster files 1 year 9 months ago #40738

  • nicogodet
  • nicogodet's Avatar
  • NOW ONLINE
  • Senior Boarder
  • Posts: 128
  • Thank you received: 31
Hi,

0. If you want more flexibility, you can check the underlying lib for reading SELAFIN in Python (github.com/pprodano/pputils) and use numpy, rasterio to create rasters.

1. Indeed PostTelemac is not the best for your needs here.
2. QGIS (at least in 3.22 and above) can generate rasters from SELAFIN (alg: "native:meshrasterize") for a fixed time step. There is no GDAL command (github.com/qgis/QGIS/blob/master/src/ana...mexportmesh.cpp#L821)

I would personally suggest scripting around QGIS alg "native:meshrasterize" if you now enough about PyQGIS API.
If not, 0.
The administrator has disabled public write access.
The following user(s) said Thank You: R.Wei

Converting selafin file to raster files 1 year 9 months ago #40741

  • a.barton
  • a.barton's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 531
  • Thank you received: 141
You may also wish to investigate Blue Kenue's "Tools > Map Object..." option and the the inverse "Tools > Map File(s)..." option. Please post to the Blue Kenue forum if this interests you further...

2022-08-10_BK_MeshToGrid.png


Kindly,
Alan
The administrator has disabled public write access.
The following user(s) said Thank You: josiastud

Converting selafin file to raster files 1 year 9 months ago #40742

  • a.barton
  • a.barton's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 531
  • Thank you received: 141
And, possibly of interest, depending on your needs and intent, could be Blue Kenue's ability to animate multi-frame meshes which can then be recorded to a file.

2022-08-10_BK_Movie.png


Kindly,
Alan
The administrator has disabled public write access.

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.