我正在尝试使用DSM光栅文件和包含CCTV摄像机信息的.shp文件在QGIS中执行视域分析。示例如下:
Camera loc, Easting, Northing,
Montpellier Station 359205 174540
Cheltenham Road, Station Road 358930 174586
Cheltenham Road, Zetland Road 358870 174734
Stapleton Road, Warwick Road 360634 174391
Rawnsley House, Lift #2 360341 173998
Rawnsley House, Main entrance (external) 360341 173998
Rawnsley House, Car park 360341 173998
Rawnsley House, Lift lobby 360341 173998
Rawnsley House, Left front (External PTZ) 360341 173998
Lower Ashley Road/Milpond Street 360375 174247
Wills Drive, Door panel 360409 173822
Twinnel House, Rear right (External PTZ) 360419 173813
但是,Python会产生以下错误消息:
Traceback (most recent call last):
File "C:/Users/Lucas/.qgis2/python/plugins\ViewshedAnalysis\viewshedanalysis.py", line 161, in run
outPath = ViewshedAnalysisDialog.returnOutputFile(self.dlg)
File "C:/Users/Lucas/.qgis2/python/plugins\ViewshedAnalysis\viewshedanalysisdialog.py", line 60, in returnOutputFile
return str(l)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 55: ordinal not in range(128)
我尝试按Mickaël Bucas建议解决问题。但是因为我不知道如何处理python(我熟悉R,如果这有帮助)并且不知道如何将其他解决方案转移到我的问题......有人可以解释-too-技术方法如何解决这个问题?我看到这与编码有关。 shp文件以UTF-8编码。至少这是在我将它们导入QGIS时指定的。我也想避免
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
(见this post)
谢谢!