<div>I'm using GDAL/OGR 1.6.1 with ActivePython 2.6.4-10 and cx_Oracle-5.0.3-11g. I am trying to connect to an Oracle 11g instance.</div><div><br></div>This works:<div><br></div><div> ogr2ogr -f "KML" emp.kml OCI:scott/tiger "EMP"</div>
<div><br></div><div>What am I doing wrong. This fails, ds is None:</div><div><br></div><div><div>from osgeo import ogr</div><div><br></div><div>try:</div><div> d = ogr.GetDriverByName('OCI')</div><div>except:</div>
<div> print "Unable to GetDriverByName"</div><div> quit()</div><div><br></div><div>ds = None</div><div><br></div><div>try:</div><div> ds = ogr.Open('OCI:scott/tiger')</div><div>except:</div><div>
print "Unable to open OCI connection"</div><div> quit()</div><div><br></div><div>if ds is None:</div><div> print "Unable to open Oracle connection", ds</div><div> quit()</div><div><br></div>
<div>lyr = ds.GetLayerByName('EMP')</div><div>number = lyr.GetFeatureCount()</div><div><br></div><div>print "Features: " + str(number)</div><div><br></div><div><br></div><div><br></div><div><br></div>-=--=---=----=----=---=--=-=--=---=----=---=--=-=-<br>
Eric B. Wolf New! 720-334-7734<br>USGS Geographer<br>Center of Excellence in GIScience<br>PhD Student <br>CU-Boulder - Geography<br><br>GPG Public Key: <a href="http://www.h4h.net/ebwolf.public.key.txt">http://www.h4h.net/ebwolf.public.key.txt</a><br>
</div>