diff --git a/pages/common/ogr2ogr.md b/pages/common/ogr2ogr.md index d642724fdd..5d7c8a129b 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 0493dedddb..99db90371d 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'}}"`