mirror of https://github.com/CrimsonTome/tldr.git
ogr2ogr, ogrinfo: refresh (#7904)
parent
3eb4ea459a
commit
c9cfd04065
|
@ -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`
|
||||
|
|
|
@ -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'}}"`
|
||||
|
|
Loading…
Reference in New Issue