Skip to content

Instantly share code, notes, and snippets.

@seenureddy
Last active July 4, 2017 17:20
Show Gist options
  • Save seenureddy/d0b37d252fb8fe0ae7b5 to your computer and use it in GitHub Desktop.
Save seenureddy/d0b37d252fb8fe0ae7b5 to your computer and use it in GitHub Desktop.
Install postgis dependencies:
sudo apt-get install binutils libproj-dev gdal-bin
Install the postgis:
sudo apt-get install postgresql-9.3-postgis-2.1
follow this link: `https://grasswiki.osgeo.org/wiki/Compile_and_Install_Ubuntu`
Install SQLite, SVN and dependencies for compiling PROJ, GEOS, GDAL/OGR, GRASS, GDAL-GRASS-PLUGIN
sudo apt-get install build-essential flex make bison gcc libgcc1 g++ cmake ccache python python-dev python-opengl python-wxversion python-wxtools python-wxgtk2.8 python-dateutil libgsl0-dev python-numpy \
wx2.8-headers wx-common libwxgtk2.8-dev libwxgtk2.8-dbg libwxbase2.8-dev libwxbase2.8-dbg libncurses5-dev zlib1g-dev gettext libtiff-dev libpnglite-dev libcairo2 libcairo2-dev sqlite3 libsqlite3-dev libpq-dev \
libreadline6 libreadline6-dev libfreetype6-dev libfftw3-3 libfftw3-dev libboost-thread-dev libboost-program-options-dev resolvconf libjasper-dev subversion libav-tools libavutil-dev ffmpeg2theora \
libffmpegthumbnailer-dev libavcodec-dev libxmu-dev libavformat-dev libswscale-dev checkinstall libglu1-mesa-dev libxmu-dev ghostscript
> for mysql support, libmysqlclient-dev is required
sudo apt-get install libmysqlclient-dev
> for netcdf support, netcdf-bin and libnetcdf-dev is required
sudo apt-get install netcdf-bin libnetcdf-dev
PROJ.4:
> Install the dev package (possibly without support for datumgrid):
sudo apt-get install libproj-dev
GEOS:
> Install the dev package:
sudo apt-get install libgeos-dev
GDAL:
> Install the dev package (possibly without support for datumgrid):
sudo apt-get install libgdal-dev
> For support of WMS in wxGUI install Python gdal bindings:
sudo apt-get install python-gdal
Precompiled Dev Packeges for GDAL, PROJ, GEOS:
sudo apt-get install libproj-dev libgdal-dev python-gdal libgeos-dev
Follow this links to install PROJ, GEOS, GDAL (in mentioned order)
PROJ: https://docs.djangoproject.com/en/1.8/ref/contrib/gis/install/geolibs/#proj4
GEOS: https://docs.djangoproject.com/en/1.8/ref/contrib/gis/install/geolibs/#geos
GDAL: https://docs.djangoproject.com/en/1.8/ref/contrib/gis/install/geolibs/#gdal
IF you ran into this Error:
psql pg_testing -c "create extension postgis"
ERROR: could not load library "/usr/lib/postgresql/9.3/lib/postgis-2.1.so": /usr/lib/liblwgeom-2.1.3.so: undefined symbol: GEOSDelaunayTriangulation
> identify the existence of outdated ligbeos libraries
$ locate libgeos_c.so
> Removal of old libgeos packages some .so files were inadvertently left behind.
$ sudo rm /usr/local/lib/libgeos_c.so*
$ sudo rm /usr/local/src/geos-3.3.1/capi/.libs/libgeos_c.so*
$ sudo ldconfig
$ sudo su postgres
$ /etc/init.d/postgresql restart
POSTGRES:
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
(Ans:)
Edit: postgresql.conf
sudo vim /etc/postgresql/9.3/main/postgresql.conf
Enable or add:
listen_addresses = '*'
Restart the database engine:
sudo service postgresql restart
Besides, you can check the file: pg_hba.conf
sudo vim /etc/postgresql/9.3/main/pg_hba.conf
And add your network or host address:
host all all 104.131.189.54(Ip-Adress)/24 md5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment