[Gdal-dev] Ogr and Postgis support

Lucian Canacheu lcanacheu at zappmobile.ro
Sat Sep 29 06:41:29 EDT 2007


Hi Gus,
In short, no. PostGIS support is disabled by default and if you user the 
binary distro fromgdal.org, that it is a "minimalist" build. Whatever 
Python bindings you add to it you won't get PostGIS support - it is not 
"enabled" in that distribution.
I passed over your messages. I'm using Python bindings for GDAL/OGR/OSR 
with PostGIS and  a couple of years  ago (I think with version 1.3.0 or 
so) I had very  tough times trying to install GDAL binaries into a 
Python "clean" environment. I've tried lots of things and in my opinion 
it was not the right way to do it. So, it may sound scary, you have to 
build yourself most of the needed libraries from sources (in this order) 
- proj4.5, libecw3.3, install Postgresql and PostGIS, geos2.2.3. The 
GDAL compilation works flawlessly on Win32 with VS 2003 and on Linux 
with compiler gcc 3.4.6.
I used these setup procedures ever since GDAL v 1.3.x. Give it a try and 
you'll see it works.
If you work this way, you'll have the chance to enable PostGIS 
extensions on Win32 platform. These are disabled by default:

# PostGIS Libraries
#PG_INC_DIR = n:\pkg\libpq_win32\include
#PG_LIB = n:\pkg\libpq_win32\lib\libpqdll.lib wsock32.lib
in the nmake.opt file

On Linux, you have to do something like this:
./configure --with-python=/opt/python-2.4.4/bin/python 
--with-postgres-includes=/usr/include/pgsql 
--with-postgres-libraries=/usr/lib

in order to enable PostGIS.

Cheers,
Lucian


-- 

Lucian Canacheu

Glipco Srl Deva
IT/GIS/Tech
Mobile: +40 788 503 385
E-mail: lcanacheu at glipco.ro




Gustavo Ces wrote:
> Hi all,
>  
>     I�ve posted a few weeks ago about gdal installing in a python 2.4 
> "clean" version. I�ve achieved to install
> python, gdal ( win bin & python bindings ), and other stuff ( with 
> your help). But now i�ve got a problem. I can connect to Posgis with 
> pygresql, but i can�t do the same with gdal. Running 'ogrinfo 
> --formats', there isn�t a postgis one. So i supose there isn�t support 
> in Gdal�s ogr distribution for this DBMS. Maybe i�m wrog. Any help?
>     Thanks in advance,
>  
> Gus
>
>
> __________ NOD32 2556 (20070928) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.eset.com
> ------------------------------------------------------------------------
>
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/gdal-dev
>
>
> __________ NOD32 2556 (20070928) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.eset.com
>   


-- 

Lucian Canacheu

Glipco Srl Deva
IT/GIS/Tech
Mobile: +40 788 503 385
E-mail: lcanacheu at glipco.ro






More information about the Gdal-dev mailing list