<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16640" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=031555314-06052008>Hello. I am
using GDAL/OGR from Python 2.5 and believe that I am having trouble using the
PostgreSQL driver. (The problem I am having is similar or identical to one
posted previously, but for which I can find no answer: <A
href="http://www.nabble.com/gdal-Python-bindings-and-postgis-question-td15705650.html">http://www.nabble.com/gdal-Python-bindings-and-postgis-question-td15705650.html</A>.)</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=031555314-06052008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=031555314-06052008>I am using Python
2.5 on Windows. I have C:\gdalwin32-1.5 in place, and have the Postgres
drivers in C:\gdalwin32-1.5\bin\gdalplugins (libpq.dll, and ogr_PG.dll). I
have also installed the Python bindings. When I run the ogrinfo
utility from a command line, I can use the Postgres driver with no apparent
problem.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=031555314-06052008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=031555314-06052008>For example, when I
run...</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=031555314-06052008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=031555314-06052008>ogrinfo
PG:"host=localhost user=postgres password=sergtsop dbname=arcturus" -al
-summary</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=031555314-06052008><FONT face=Arial size=2>I get
results...</FONT></SPAN></DIV>
<DIV><SPAN class=031555314-06052008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=031555314-06052008>INFO: Open of
`PG:host=localhost user=postgres password=password
dbname=mydb'<BR> using driver `PostgreSQL'
successful.</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=031555314-06052008>Layer name:
streets<BR>Geometry: Line String<BR>Feature Count: 19187<BR>Extent: (-77.116646,
38.793179) - (-76.909538, 38.995243)<BR>Layer SRS WKT: </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=031555314-06052008>[...etc...]</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=031555314-06052008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=031555314-06052008>However, from within
Python, the ogr module doesn't seem to be able to find the 'PostgreSQL'
driver. Below I have pasted in text from my Python console. You can
see that I can get the 'ESRI Shapefile' driver; but if I try to get 'PostgreSQL'
driver, I get None back.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=031555314-06052008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=031555314-06052008>>>> from
osgeo import ogr<BR>>>> ogrEsriDriver = ogr.GetDriverByName('ESRI
Shapefile')<BR>>>> print ogrEsriDriver<BR><osgeo.ogr.Driver; proxy
of <Swig Object of type 'OGRDriverShadow *' at 0xaf3a78...<BR>>>>
ogrPgDriver = ogr.GetDriverByName('PostgreSQL')<BR>>>> print
ogrPgDriver</SPAN></FONT><FONT face=Arial size=2><SPAN
class=031555314-06052008><BR>None<BR>>>></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=031555314-06052008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=031555314-06052008>So, I believe that
GDAL/OGR are installed and working, and that the Python bindings are generally
working. But i</SPAN></FONT><FONT face=Arial size=2><SPAN
class=031555314-06052008>s there another step I must take to help the Python
bindings find </SPAN></FONT><FONT face=Arial size=2><SPAN
class=031555314-06052008>the Postgres driver?</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=031555314-06052008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=031555314-06052008>Many
thanks,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=031555314-06052008>Pat</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=031555314-06052008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=031555314-06052008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=031555314-06052008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=031555314-06052008> </SPAN></FONT></DIV></BODY></HTML>