大网数据广告活动
Linux 与通用命令

ogr2ogr · 常用命令示例

· 52CE 我爱测

Convert geospatial vector data between file formats. > More information: <https://gdal.org/en/stable/programs/ogr2ogr.html>.

ogr2ogr

Convert geospatial vector data between file formats. More information: https://gdal.org/en/stable/programs/ogr2ogr.html.

  • Convert a Shapefile into a GeoPackage:

ogr2ogr -f GPKG

  • Reduce a GeoJSON to features matching a condition:

ogr2ogr -where '' -f

  • Change coordinate reference system of a GeoPackage from EPSG:4326 to EPSG:3857:

ogr2ogr -s_srs -t_srs -f GPKG

  • Convert a CSV file into a GeoPackage, specifying the names of the coordinate columns and assigning a coordinate reference system:

ogr2ogr -f GPKG -oo X_POSSIBLE_NAMES= -oo Y_POSSIBLE_NAMES= -a_srs

  • Load a GeoPackage into a PostGIS database:

ogr2ogr -f PostgreSQL PG:dbname=""

  • Clip layers of a GeoPackage file to the given bounding box:

ogr2ogr -spat -f GPKG

来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
tldr-pages contributors
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。