1、安装完postgis之后,打开PostGIS PostGIS Bundle 3 for PostgreSQL x64 12 Shapefile and DBF Loader Exporter
2、填写数据库信息
3、填完后就显示成功了
4、点击Add File 添加shp文件
5、点击import导入
6、去数据库查看有表存在了
其他拓展:postgis库创建表,查询数据等操作
CREATE TABLE my_test_table (id SERIAL PRIMARY KEY,geom GEOMETRY(Point, 4326),name VARCHAR(128)
);CREATE extension postgis;CREATE INDEX my_test_table_gixON my_test_tableUSING GIST (geom);INSERT INTO my_test_table (geom) VALUES (ST_GeomFromText('POINT(0 0)', 4326)
);SELECT id, name,st_astext(geom)
FROM my_test_table
WHERE ST_DWithin(geom,ST_GeomFromText('POINT(0 0)', 4326),0.01
);