in memory raster output

51 views
Skip to first unread message

Douglas Long

unread,
Jun 15, 2021, 11:52:42 AM6/15/21
to WhiteboxTools
Do Whitebox tools support writing to in-memory rasters?

 Pseudo-code example below.

input_dem =  "DEM.tif"
out_ram_raster = "in_memory_raster"
wbt.elev_percentile( input_dem, out_ram_raster , 15, 15)

final_output = "output.tif"
wbt.elev_percentile(out_ram_raster , final_output, 15, 15)

Jean-François Bourdon

unread,
Jun 16, 2021, 10:09:26 AM6/16/21
to WhiteboxTools
Unfortunately not, each output/input must be written to disk as each call to WhiteboxTools lunches a new process that has no knowledge of what happened before. The closest you could currently get is to create a RAM disk (with ImDisk for example on Windows) and use it as your memory buffer but it's not the same as a reel in_memory raster. See also github.com/jblindsay/whitebox-tools/issues/52 and github.com/jblindsay/whitebox-tools/issues/68

Douglas Long

unread,
Jun 16, 2021, 11:42:24 AM6/16/21
to WhiteboxTools
Can I create in-memory rasters VIA Rust? instead of CMD?

Jean-François Bourdon

unread,
Jun 16, 2021, 2:38:43 PM6/16/21
to WhiteboxTools
I can't say... maybe that's something now possible with the new plugin capabilities added in v1.5 . One thing I've done in past is to write a new tool where I combined the source-code of the two tools (in your case, a loop of ElevPercentile). That way, everything stay in memory and you only have one read and one write on disk instead two of both... but that's not a very flexible solution. My reason to have done that was because the read/write process was taking more time than the actual processing and I wanted to save the useless 45 secondes of I/O between the two tools.

Douglas Long

unread,
Jun 16, 2021, 2:53:41 PM6/16/21
to Jean-François Bourdon, WhiteboxTools
Good call!

I can write chained processes in the source code and compile.



--
You received this message because you are subscribed to a topic in the Google Groups "WhiteboxTools" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/whiteboxtools/KBxWYg5_mPk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to whiteboxtool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/whiteboxtools/e7418c1b-ad2c-478a-b597-896996c211f8n%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Reply all
Reply to author
Forward
0 new messages