geopython / diving-into-pygeoapi

pygeoapi is an OGC Reference Implementation supporting numerous OGC API specifications. This workshop will cover publishing geospatial data to the Web using pygeoapi in support of the suite of OGC API standards.
https://dive.pygeoapi.io
MIT License
20 stars 17 forks source link

Exercise 2 - GDAL - show how to use from Docker #151

Closed justb4 closed 5 months ago

justb4 commented 5 months ago

Simlar to OWSLib in Setup chapter: GDAL commandline can be used by running a minimal Docker Container with bash. By mounting volumes even local data can be converted.

justb4 commented 5 months ago

Like

docker pull ghcr.io/osgeo/gdal:alpine-small-latest

Using OGR:


docker run -it --rm ghcr.io/osgeo/gdal:alpine-small-latest ogrinfo --formats

cd git/workshop/exercises
docker run -v $(pwd)/data:/work -it --rm ghcr.io/osgeo/gdal:alpine-small-latest ogrinfo /work/bathingwater-estonia.geojson

INFO: Open of `/work/bathingwater-estonia.geojson'
      using driver `GeoJSON' successful.
1: bathingwater-estonia (Point)

convert to GPKG

docker run -v $(pwd)/data:/work -it --rm ghcr.io/osgeo/gdal:alpine-small-latest ogr2ogr -f "GPKG"  /work/bathingwater-estonia.gpkg  /work/bathingwater-estonia.geojson

etc