type
Post
status
Published
date
Jan 26, 2026
slug
shape2postgis
summary
使用轻量级 GDAL 容器运行 ogr2ogr 工具,将 .shp 文件导入数据库。
tags
Docker
Postgis
category
速查
icon
fas fa-globe-stand
password
  • -nln public.shape: New Layer Name,指定导入后数据库中的 Schema 和表名 (即 public 模式下的 shape 表)。
  • -lco GEOMETRY_NAME=geom: 重要,PostGIS 默认习惯使用 geom 作为几何列名,而 GDAL 默认可能是 wkb_geometry,这里强制指定为 geom 以符合习惯