From c9cfd040659de3f90feee5a289146775343d9b1a Mon Sep 17 00:00:00 2001 From: Jakob Miksch Date: Sat, 19 Mar 2022 19:16:51 +0100 Subject: [PATCH] ogr2ogr, ogrinfo: refresh (#7904) --- pages/common/ogr2ogr.md | 6 +++++- pages/common/ogrinfo.md | 14 +++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/pages/common/ogr2ogr.md b/pages/common/ogr2ogr.md index d642724fd..5d7c8a129 100644 --- a/pages/common/ogr2ogr.md +++ b/pages/common/ogr2ogr.md @@ -1,12 +1,16 @@ # ogr2ogr -> Convert Simple Features data between file formats. +> Convert geospatial vector data between file formats. > More information: . - Convert a Shapefile into a GeoPackage: `ogr2ogr -f GPKG {{path/to/output}}.gpkg {{path/to/input}}.shp` +- Reduce a GeoJSON to features matching a condition: + +`ogr2ogr -where '{{myProperty > 42}}' -f {{GeoJSON}} {{path/to/output.geojson}} {{path/to/input.geojson}}` + - Change coordinate reference system of a GeoPackage from `EPSG:4326` to `EPSG:3857`: `ogr2ogr -s_srs {{EPSG:4326}} -t_srs {{EPSG:3857}} -f GPKG {{path/to/output}}.gpkg {{path/to/input}}.gpkg` diff --git a/pages/common/ogrinfo.md b/pages/common/ogrinfo.md index 0493deddd..99db90371 100644 --- a/pages/common/ogrinfo.md +++ b/pages/common/ogrinfo.md @@ -15,6 +15,18 @@ `ogrinfo {{path/to/input.gpkg}} {{layer_name}}` -- Only show summary information about a specific layer of a data source: +- Show summary information about a specific layer of a data source: `ogrinfo -so {{path/to/input.gpkg}} {{layer_name}}` + +- Show summary of all layers of the data source: + +`ogrinfo -so -al {{path/to/input.gpkg}}` + +- Show detailed information of features matching a condition: + +`ogrinfo -where '{{attribute_name > 42}}' {{path/to/input.gpkg}} {{layer_name}}` + +- Update a layer in the data source with SQL: + +`ogrinfo {{path/to/input.geojson}} -dialect SQLite -sql "{{UPDATE input SET attribute_name = 'foo'}}"`