Skip to content

Commit

Permalink
feat(ogr): configurable docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
missinglink committed Sep 25, 2024
1 parent 003b97a commit c213672
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,12 @@ cat jsonstream | wof feature ogr example.gpkg --format='GPKG'
cat jsonstream | wof feature ogr example.parquet --format='Parquet'
```

use a dockerized version of `ogr2ogr` (to avoid installing locally):

```bash
wof feature ogr --docker
```

see: https://gdal.org/programs/ogr2ogr.html

#### Feature Properties
Expand Down
7 changes: 6 additions & 1 deletion bin/cmd/feature/ogr.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ module.exports = {
default: false,
describe: 'use a docker image for ogr2ogr'
})
yargs.option('image', {
type: 'string',
default: 'ghcr.io/osgeo/gdal:alpine-normal-latest',
describe: 'docker image to use'
})
},
handler: (argv) => {
const tap = new Stream.PassThrough()
Expand Down Expand Up @@ -74,7 +79,7 @@ function docker (argv) {
return stream.shell.duplex('docker', [
'run', '-i', '--rm',
'-v', `${path.dirname(path.resolve(process.cwd(), argv.dst))}:/work`,
'ghcr.io/osgeo/gdal:alpine-normal-latest',
argv.image,
'ogr2ogr',
...flags(argv),
`/work/${path.basename(argv.dst)}`,
Expand Down

0 comments on commit c213672

Please sign in to comment.