0
嘗試解析在Django殼.SHP:GeoDjango內置GDAL_ERROR時
from django.contrib.gis.gdal import DataSource
ds = DataSource('/Users/.../Downloads/Iceland.shp')
得到:
GDAL_ERROR 4: Unable to open /Users/.../Downloads/Iceland.shx or /Users/.../Downloads/Iceland.SHX.
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/Users/.../lib/python2.7/site-packages/django/contrib/gis/gdal/datasource.py", line 78, in __init__
raise GDALException('Could not open the datasource at "%s"' % ds_input)
GDALException: Could not open the datasource at "/Users/.../Downloads/Iceland.shp"
文件存在,文件模式爲755,.SHX文件是正確的(在測試在線服務)。 後來我嘗試測試.KML文件,它的工作原理
操作系統:Mac OS X 10.10.5
我會嘗試一些事情:1。檢查的強制.SHX,.SHP和.dbf文件在同一目錄下。 2.檢查沒有其他程序使shapefile打開(並鎖定)。 3.在QGIS/ArcGIS中打開shapefile並驗證幾何體。 4.嘗試另一個shapefile。 – Alexander