ogr2ogr, ogrinfo: refresh (#7904)

feature/ed-update
Jakob Miksch 2022-03-19 19:16:51 +01:00 committed by GitHub
parent 3eb4ea459a
commit c9cfd04065
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 2 deletions

View File

@ -1,12 +1,16 @@
# ogr2ogr
> Convert Simple Features data between file formats.
> Convert geospatial vector data between file formats.
> More information: <https://gdal.org/programs/ogr2ogr.html>.
- 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`

View File

@ -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'}}"`