ogr.Open()打开文件出问题

10 views
Skip to first unread message

GeoSun

unread,
May 7, 2009, 1:54:40 AM5/7/09
to gdal+python+GIS+geosings论坛
ds = ogr.Open("g:/world.shp")

Traceback (most recent call last):
File "<pyshell#49>", line 1, in <module>
ds = ogr.Open("g:/world.shp")
File "D:\Program Files\Python25\lib\site-packages\ogr.py", line 127,
in Open
raise OGRError, 'Unable to open: ' + filename
OGRError: Unable to open: g:/world.shp

看了代码,应该是ds_o = _gdal.OGROpen( filename, update, 'NULL' )返回null ,仔细看了文件
路径,应该没问题啊,不知什么情况?

GeoSun

unread,
May 7, 2009, 3:48:27 AM5/7/09
to gdal+python+GIS+geosings论坛

Macho

unread,
May 7, 2009, 4:03:41 AM5/7/09
to gdal+python+GIS+geosings论坛
ds = ogr.Open("g://world.shp")

GeoSun

unread,
May 7, 2009, 5:23:40 AM5/7/09
to gdal+python+GIS+geosings论坛
我晕啊,还是不行,一样的错,那ds_o总是为null,

raise OGRError, 'Unable to open: ' + filename
ogr.OGRError: Unable to open: g://world.shp
还有那gdal.OGROpen()调试时为啥不能进入到函数内部啊

linux23...@gmail.com

unread,
May 7, 2009, 10:21:23 AM5/7/09
to gdal+python+GIS+geosings论坛
文件有没有缺失?

有没有dbf和shx?

GeoSun

unread,
May 7, 2009, 11:08:20 AM5/7/09
to gdal+python+GIS+geosings论坛
哦,sorry,贴过来一大堆,就把shx漏了。。。麻烦了。。

On 5月7日, 下午10时21分, "linux23maill...@gmail.com"

Reply all
Reply to author
Forward
0 new messages