我這裏說明一下我安裝的軟件版本:
按照安裝順序介紹
1.安裝postgresql10.2
https://zhuanlan.zhihu.com/p/81814954
2.安裝高版本的gcc(因爲在安裝postgis的依賴的時候,進行編譯需要高版本的gcc)
gcc-8.3.0.tar.gz
gmp-6.1.0.tar.bz2
isl-0.18.tar.bz2
mpfr-3.1.4.tar.bz2
安裝過程:https://blog.csdn.net/davidhopper/article/details/79681695
3.安裝postgis相關依賴
gdal-2.3.2.tar.gz
geos-3.7.0.tar.bz2
json-c-json-c-0.13.1-20180305.tar.gz
libxml2-2.9.0.tar.gz
proj-5.2.0.tar.gz
安裝步驟:https://www.jianshu.com/p/e08dbc60a3b2
4.安裝postgis-2.5.0.tar.gz
- cd 到解壓目錄下,然後運行以下命令: ./configure --prefix=/usr/local/postgis
–with-pgconfig=/usr/local/postgresql-10.2/bin/pg_config --with-projdir=/usr/local/proj-5.2.0 --with-geosconfig=/usr/local/geos-3.7.0/bin/geos-config --with-gdalconfig=/usr/local/gdal-2.3.2/bin/gdal-config --with-jsondir=/usr/local/json-c-0.13.1 --with-xml2config=/usr/local/libxml2-2.9.0/bin/xml2-config - make && make install
出現問題可參考以下博客:
https://www.cnblogs.com/ilifeilong/p/6979288.html(對postgresql加入postgis擴展,並出現問題的相應解決方法)
https://zhuanlan.zhihu.com/p/33149524(xxx is not in the sudoers file.This incident will be reported.的解決方法)