Closed zachsa closed 2 years ago
Good point, maybe we add a commandArgs
option like:
ogr2ogr('/home/.../path/to/spatial/file', {
command: 'docker',
commandArgs: ['run', '-v /home/:/home', '--rm', 'osgeo/gdal', 'ogr2ogr'],
options: ['ogr2ogr args']
})
Thoughts?
I will have a look sometime this week and make a pull request
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.
Sorry, I never got round to this
One possible workaround is to create a small shell script that receives all parameters.
cat /usr/local/bin/dk_ogr2ogr.sh
#!/bin/bash
docker run -v /tmp:/data --rm osgeo/gdal ogr2ogr $@
Then use the script, using options['command'] = "/usr/local/bin/dk_ogr2ogr.sh"
It works, but it would be nice to support this on ogr2ogr module.
Hi,
I previously submitted a pull request for allowing for switching the command to use ogr2ogr via Docker (https://github.com/wavded/ogr2ogr/pull/60). However I've just checked now and it's not working. Looking at the code I'm actually not sure that it ever worked... I apologise!
I would like to use this feature now though, so I would like to fix it.
Looking at the
run
function: https://github.com/wavded/ogr2ogr/blob/master/index.ts#L147-L170, it doesn't seem like it's possible to specify an alternative command that requires args.for example, If I try to run via docker (this is currently in the readme):
Then I get an error:
In the code
It looks like the command should actually just be
docker
, and the args should be['run', '-v', etc. etc., ... then the ogr2ogr args]
.But currently there is no way of specifying this