天天看點

postgresql空間資料庫入門

1、安裝軟體

postgresql-10.14-1-windows-x64.exe

官網:​​​https://www.enterprisedb.com/downloads/postgresql​​​ 連結:​​https://pan.baidu.com/s/1aMaEGwhR6vFEY5B87-O9bw​​ 提取碼:fba5

2、設定防火牆

postgresql空間資料庫入門
postgresql空間資料庫入門

3、設定區域網路可通路IP

在安裝目錄的\data下

IP可設定所有通用0.0.0.0/0,也可以按需設定,别忘了設定防火牆

postgresql空間資料庫入門

4、打開自帶的可視化工具,連接配接資料庫,自行建立資料庫等等

postgresql空間資料庫入門
postgresql空間資料庫入門
postgresql空間資料庫入門
postgresql空間資料庫入門

5、導入shp

安裝可視化工具

postgis-bundle-pg10x64-setup-2.4.0-1.exe

連結:​​https://pan.baidu.com/s/1SqJSsR8af6teOkyYoB1jsg​​ 提取碼:urix安裝完後打開工具,連接配接資料庫

postgresql空間資料庫入門
postgresql空間資料庫入門

先給導入的資料庫增加空間擴充功能:

postgresql空間資料庫入門

在這打開連接配接之後輸入

CREATE EXTENSION postgis;
CREATE EXTENSION pgrouting;
CREATE EXTENSION postgis_topology;
CREATE EXTENSION fuzzystrmatch;
CREATE EXTENSION postgis_tiger_geocoder;
CREATE EXTENSION address_standardizer;      
postgresql空間資料庫入門

隻有導入上面的擴充,資料庫才支援導入空間資料,謹記!!!繼續導入shp的設定

postgresql空間資料庫入門

導入shp檔案設定,下面是導入面的設定,如果是線好像還要勾選最後一項

postgresql空間資料庫入門
postgresql空間資料庫入門

導入完成

postgresql空間資料庫入門

繼續閱讀