私はまだPythonの初心者ですが、クリッピング、陰影起伏、勾配の作成など、いくつかのジオプロセシングプロセスを実行するスタンドアロンプログラムを考え出そうとしています。Tkinter を使用してスタンドアロン用の GUI を作成しています。DLLモジュールのロードに失敗したというエラーが発生した人は誰でも、次のスクリプトを思いつくことができました。エラーを修正する方法はありますか???
import arcpy
from arcpy import os, sys, time
import operator
from osgeo import gdal, gdalnumeric, ogr, osr
from Tkinter import *
import tkFileDialog
#import ogr
import subprocess
master = Tk()
inraster = 'F:/practice/data/DEM/srtm_44_13_mau_prj36s.tif'
inshape = 'F:/practice/data/Boundary/eastern_mau.shp'
ds = ogr.Open(inshape)
lyr = ds.GetLayer(0)
lyr.ResetReading()
ft = lyr.GetNextFeature()
while ft:
country_name = ft.GetFieldAsString('admin')
outraster = inraster.replace('.tif','_%s.tif'% country_name.replace(' ','_' ))
subprocess.call(['gdalwarp', inraster, outraster,'-cutline',inshape,'-crop_to_cutline','-cwhere',"'admin'='%s'" % country_name])
ft = lyr.GetNextFeature()
ds = None
これはトレースバックです:
Traceback (most recent call last):
File "F:\GIS programming\project scripts\sem proj\gamesGUI.py", line 264, in <module>
from osgeo import gdal, gdalnumeric, ogr, osr
File "C:\Python27\ArcGIS10.1\lib\site-packages\osgeo_init_.py", line 21, in <module>
gdal = swig_import_helper()
File "C:\Python27\ArcGIS10.1\lib\site-packages\osgeo__init_.py", line 17, in swig_import_helper
_mod = imp.load_module('_gdal', fp, pathname, description)
ImportError: DLL load failed: The specified module could not be found.