postgresql安装postgis

首先安装postgresql:

Linux平台的安装查看官方文档就可以了:https://www.postgresql.org/download/

windows的安装包在上面的下载地址没有最新的,可以查看:https://www.enterprisedb.com/downloads/postgres-postgresql-downloads

 

postgis安装:

先看官方文档吧:https://postgis.net/docs/manual-3.2/postgis_installation.html

windows下可以用stackbuilder安装,postgresql安装后自带

Linux下参考官网,Ubuntu下试下:apt install postgis

 

关键点来了,安装之后并不能马上使用,需要创建扩展:

CREATE EXTENSION postgis;
CREATE EXTENSION postgis_topology;
CREATE EXTENSION fuzzystrmatch;
CREATE EXTENSION address_standardizer;
CREATE EXTENSION address_standardizer_data_us;
CREATE EXTENSION postgis_tiger_geocoder;
CREATE EXTENSION postgis_sfcgal;
CREATE EXTENSION postgis_raster;