通过pgsql2shp 工具实现
语法
pgsql2shp -f <path to output shapefile> -h <hostname> -u <username> -P <password> databasename "<query>"
用例
pgsql2shp -f qds_cnt -h localhost -u postgres -P password gisdb "SELECT sp_count,geom FROM grid50_rsa WHERE province = 'Gauteng'"
原文链接:https://www.f2er.com/postgresql/194423.html