Docker image for format conversion based on GDAL/OGR.
The image is meant to be used for one-off docker run
commands running a specific conversion task.
The script ./ogr-convert.sh
in the working directory should be called when running a container.
The default command prints the script usage.
Build docker image after changes using command:
docker build -t wetransform/conversion-gdal:latest .
Convert remote file, result is stored in internal container volume:
docker run -it wetransform/conversion-gdal:latest ./ogr-convert.sh --source https://wetransform.box.com/shared/static/2fe8kbl6psu3ul2bth3uqymx2chlwkdc.gml --target-name hydroEx.shp -f "ESRI Shapefile"
Convert remote file, result is stored in mounted folder as current user:
docker run -it --user=$(id -u):$(id -g) -v $(pwd):/data wetransform/conversion-gdal:latest ./ogr-convert.sh --source https://wetransform.box.com/shared/static/2fe8kbl6psu3ul2bth3uqymx2chlwkdc.gml --target-dir /data --target-name hydroEx.json -f "GeoJson"
Similarly, files from mounted volumes can be converted as well, by providing a file path resolvable in the container instead of a remote (http/https) location.
Example to mount a volume and run docker image:
docker run -it -v <local_path_to_folder_to_be_mounted>:/data wetransform/conversion-gdal:latest ./ogr-convert.sh --source /data/<example.gml> --target-dir /data/target --target-name test.shp -f "ESRI Shapefile"