Issue when using rasterio dataset inside Class with multiprocessing

luoyntech@...
 

I have a simple class which has a member variable of rasterio dataset. Inside the class, there is also a function wrapped by a python multiprocessing call. See below



This code is supposed to print 'Worker 0', 'Worker 1' and 'Worker 2'. However, when I actually ran this code, it printed nothing but exited normally.




I then tried to comment out the line reading the tif image using rasterio, which looks like this


This time it printed out text as I expected.




Is there any possible reason that causes this issue? Thanks!

Join main@rasterio.groups.io to automatically receive all group messages.