-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstalar_postgis.txt
35 lines (32 loc) · 1.95 KB
/
instalar_postgis.txt
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
34
35
Manual para instalar postgis en Debian 7: http://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS21Debian7src
Procedimiento:
1- Instalar librerias requeridas: "sudo apt-get install build-essential postgresql-9.1 postgresql-server-dev-9.1 libxml2-dev libgdal-dev libproj-dev libjson0-dev xsltproc docbook-xsl docbook-mathml"
2- Instalar GEOS (Geometry Engine - Open Source is a C++ port of Java Topology Suite (JTS). As such, it aims to contain the complete functionality of JTS in C++. This includes all the OpenGIS Simple Features for SQL spatial predicate functions and spatial operators, as well as specific JTS enhanced topology functions) con el siguiente código:
wget http://download.osgeo.org/geos/geos-3.4.2.tar.bz2
tar xfj geos-3.4.2.tar.bz2
cd geos-3.4.2
./configure
make
sudo make install
cd ..
3- Instalar POSTGIS:
wget http://download.osgeo.org/postgis/source/postgis-2.1.8.tar.gz
tar xfz postgis-2.1.8.tar.gz
cd postgis-2.1.8
./configure
make
sudo make install
sudo ldconfig
sudo make comments-install
4- Permitir trabajar desde el shell:
sudo ln -sf /usr/share/postgresql-common/pg_wrapper /usr/local/bin/shp2pgsql
sudo ln -sf /usr/share/postgresql-common/pg_wrapper /usr/local/bin/pgsql2shp
sudo ln -sf /usr/share/postgresql-common/pg_wrapper /usr/local/bin/raster2pgsql
5- Activando características espaciales en una base de datos:
5.1- conectarse a la base de datos.
5.2- activar el modulo: CREATE EXTENSION postgis;
5.3- activar soporte topologico: CREATE EXTENSION postgis_topology;
OTROS:
- cargar shapefile en base de datos: http://suite.opengeo.org/4.1/dataadmin/pgGettingStarted/shp2pgsql.html
- subir shapefile eod2012 a postgis "sudo -u postgres -i shp2pgsql -I -s 4326 /home/cephei/Desktop/eod2012/zonificacion_eod2012.shp eod2012 | sudo -u postgres -i psql -d memoria"
- importar csv con campos latitud y longitud: http://www.kevfoo.com/2012/01/Importing-CSV-to-PostGIS/