I have a stand alone python script using qgis that I wrote with the help of the SE question here
The script takes three arguments being; an input file path, an output file path, and another input file path. a la:
myscript.py input1.shp output.shp input2.shp
As per advice from this question the script now happily runs in parallel using gnu parallel and gives the correct output files with the following command:
parallel myscript.py {.}.shp {.}_output.shp /tmp/input.shp ::: /tmp/tile_{1..443}.shp
I want to do the work in parallel on a remote server (or servers). So I enabled a passwordless login to an available server as per this question, I installed QGIS on the remote server, copied over the script, and made it executable from bash. If I manually copy the required input files over to the server the same parallel command as above runs fine.
The problem I have is when trying to run the remote parallel work from the local machine.
There is an example for running a remote process described here
One could imagine that the equivilent gis type line as per my example might look as follows:
parallel --trc {.}_output.shp -bf /tmp/input.shp -S 192.168.88.222,: \
'myscript.py {.}.shp {.}_output.shp /tmp/input.shp' ::: /tmp/tile_{1..443}.shp
Unfortunately, there's a fundamental problem with this approach. If a GIS program calls the path to a "shapefile" as an argument; while /path/to/my/file.shp
will work most of the time, the "shapefile" actually consists of a collection of files with a common filename prefix. When run, the program actually locates whichever file it needs from the collection from the path to the ".shp" file.
This issue then becomes a problem when the gis script is operating in the remote environment since it doesn't have access to the full collection of files.
The question is then how do we solve this?
/tmp/input.shp
and/tmp/input.shx
and/tmp/input.dbf
but could include a number of others such as/tmp/input.prj