addPostgis

addPostgis

create a complex extension

For example : create a postgis
if you install postgis at first, there are some information as viewed below:
Geos-config not found
gdal-config not found
Sudo apt install libgdal-dev
You should install proj and geos first

install proj

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
tar -xvzf proj-4.8.0.tar.gz
cd proj-4.8.0
./configure --prefix=/usr/local/proj
make
make install
```
Some information ask you to install segments.
'install-recursive' failed
you have to install recursive
#### install geos
```bash
tar -jxvf geos-3.3.3.tar.bz2
cd geos-3.3.3
./configure --prefix=/usr/local/geos
make
make install
```

install swig
Install python-dev

```bash
$ ./configure --prefix=/home/postgres/Downloads/geos-3.7.2/build --enable-python
$ /Downloads/geos-3.7.2/build/bin
$ geos-config --version
> 3.7.2
```

set Enviorment

```bash
export LD_LIBRARY_PATH="/opt/geos-3.3.3/build/lib:$LD_LIBRARY_PATH"
export PATH="/opt/geos-3.3.3/build/bin:$PATH"

install postgis

tar -xvzf postgis-1.5.4.tar.gz
cd postgis-1.5.4
./configure --with-pgconfig=/usr/local/pgsql/bin/pg_config --with-projdir=/usr/local/proj --with-geosconfig=/usr/local/geos/bin/geos-config

pg_ctl -D /data/pgsql/ -l /data/pgsql/pgsql.log start
createdb template_postgis
psql -f /usr/local/pgsql/share/contrib/postgis-1.5/postgis.sql -d template_postgis
psql template_postgis
select postgis_full_version();

selectpostgis

reference
http://www.voidcn.com/article/p-yesruvml-bdv.html

Comments

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×