From ca086129584524895a97f21ac8664030db1fb710 Mon Sep 17 00:00:00 2001 From: Jakob Miksch Date: Tue, 29 Oct 2019 16:36:20 +0100 Subject: [PATCH] ogr2ogr, ogrinfo: add pages (#3337) --- pages/common/ogr2ogr.md | 24 ++++++++++++++++++++++++ pages/common/ogrinfo.md | 16 ++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 pages/common/ogr2ogr.md create mode 100644 pages/common/ogrinfo.md diff --git a/pages/common/ogr2ogr.md b/pages/common/ogr2ogr.md new file mode 100644 index 000000000..cc065db4f --- /dev/null +++ b/pages/common/ogr2ogr.md @@ -0,0 +1,24 @@ +# ogr2ogr + +> Convert Simple Features data between file formats. +> More information: . + +- Convert a Shapefile into a GeoPackage: + +`ogr2ogr -f GPKG {{output}}.gpkg {{input}}.shp` + +- Change coordinate reference system of a GeoPackage from `EPSG:4326` to `EPSG:3857`: + +`ogr2ogr -s_srs {{EPSG:4326}} -t_srs {{EPSG:3857}} -f GPKG {{output}}.gpkg {{input}}.gpkg` + +- Convert a CSV file into a GeoPackage, specifying the names of the coordinate columns and assigning a coordinate reference system: + +`ogr2ogr -f GPKG {{output}}.gpkg {{input}}.csv -oo X_POSSIBLE_NAMES={{longitude}} -oo Y_POSSIBLE_NAMES={{latitude}} -a_srs {{EPSG:4326}}` + +- Load a GeoPackage into a PostGIS database: + +`ogr2ogr -f "PostgreSQL" PG:dbname="{{database_name}}" {{input}}.gpkg` + +- Clip layers of a GeoPackage file to the given bounding box: + +`ogr2ogr -spat {{min_x}} {{min_y}} {{max_x}} {{max_y}} -f GPKG {{output}}.gpkg {{input}}.gpkg` diff --git a/pages/common/ogrinfo.md b/pages/common/ogrinfo.md new file mode 100644 index 000000000..addd1ac15 --- /dev/null +++ b/pages/common/ogrinfo.md @@ -0,0 +1,16 @@ +# ogrinfo + +> List information about an OGR-supported data source. +> More information: . + +- List layers of a GeoPackage: + +`ogrinfo {{input}}.gpkg` + +- Get detailed information about a specific layer of a GeoPackage: + +`ogrinfo {{input}}.gpkg {{layer_name}}` + +- Only show summary information about a specific layer of a GeoPackage: + +`ogrinfo -so {{input}}.gpkg {{layer_name}}`