mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-29 23:24:55 +02:00
ogr2ogr, ogrinfo: refresh (#7807)
This commit is contained in:
parent
50b1761258
commit
0f73f6aaad
2 changed files with 16 additions and 12 deletions
|
@ -1,24 +1,24 @@
|
|||
# ogr2ogr
|
||||
|
||||
> Convert Simple Features data between file formats.
|
||||
> More information: <https://gdal.org/programs/ogr2ogr.html#ogr2ogr>.
|
||||
> More information: <https://gdal.org/programs/ogr2ogr.html>.
|
||||
|
||||
- Convert a Shapefile into a GeoPackage:
|
||||
|
||||
`ogr2ogr -f GPKG {{output}}.gpkg {{input}}.shp`
|
||||
`ogr2ogr -f GPKG {{path/to/output}}.gpkg {{path/to/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`
|
||||
`ogr2ogr -s_srs {{EPSG:4326}} -t_srs {{EPSG:3857}} -f GPKG {{path/to/output}}.gpkg {{path/to/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}}`
|
||||
`ogr2ogr -f GPKG {{path/to/output}}.gpkg {{path/to/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`
|
||||
`ogr2ogr -f PostgreSQL PG:dbname="{{database_name}}" {{path/to/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`
|
||||
`ogr2ogr -spat {{min_x}} {{min_y}} {{max_x}} {{max_y}} -f GPKG {{path/to/output}}.gpkg {{path/to/input}}.gpkg`
|
||||
|
|
|
@ -3,14 +3,18 @@
|
|||
> List information about an OGR-supported data source.
|
||||
> More information: <https://gdal.org/programs/ogrinfo.html>.
|
||||
|
||||
- List layers of a GeoPackage:
|
||||
- List supported formats:
|
||||
|
||||
`ogrinfo {{input}}.gpkg`
|
||||
`ogrinfo --formats`
|
||||
|
||||
- Get detailed information about a specific layer of a GeoPackage:
|
||||
- List layers of a data source:
|
||||
|
||||
`ogrinfo {{input}}.gpkg {{layer_name}}`
|
||||
`ogrinfo {{path/to/input.gpkg}}`
|
||||
|
||||
- Only show summary information about a specific layer of a GeoPackage:
|
||||
- Get detailed information about a specific layer of a data source:
|
||||
|
||||
`ogrinfo -so {{input}}.gpkg {{layer_name}}`
|
||||
`ogrinfo {{path/to/input.gpkg}} {{layer_name}}`
|
||||
|
||||
- Only show summary information about a specific layer of a data source:
|
||||
|
||||
`ogrinfo -so {{path/to/input.gpkg}} {{layer_name}}`
|
||||
|
|
Loading…
Add table
Reference in a new issue