返回

Python2.7-NameError:名称“select_pour_point”未定义

发布时间:2022-05-18 18:48:38 199
# node.js

我在尝试为每个倾点设置变量时收到此错误。这是一个

cur point=select for point(对于points,name field,name)

NameError:名称“select_pour_point”未定义

帮助!

import shedtools as st

# Directories
SCRATCH = "C:\\SCRATCH"
OUT_FOLDER = "C:\\WATERSHEDS" 

# inputs
POUR_POINTS = "C:\\Hawaii_DEM\\Hawaii.shp"
FLOW_DIRECTION = "C:\\Hawaii_DEM\\hawaii_flwdir" 
STATS_RASTER = "C:\\HawaiiRFGrids_mm\\RF_MM_BI_Ann"                    
RASTER_NAME = "stats"
NAME_FIELD = "Id" 
STATISTICS = "MEAN"

with arcpy.da.SearchCursor(POUR_POINTS, NAME_FIELD) as cursor:
    for point in cursor:
        name = str(point[0])
        print "Working on pour point %s" % (name)
        cur_point = select_pour_point(POUR_POINTS, NAME_FIELD, name) 
        shed_raster = make_watershed_raster(FLOW_DIRECTION, cur_point, name, SCRATCH)

我收到的错误是:

Traceback (most recent call last):
  File "C:\\exercise_5.py", line 30, in 
    cur_point = select_pour_point(POUR_POINTS, NAME_FIELD, name)
NameError: name 'select_pour_point' is not defined

第30行是:

cur_point = select_pour_point(POUR_POINTS, NAME_FIELD, name) 
特别声明:以上内容(图片及文字)均为互联网收集或者用户上传发布,本站仅提供信息存储服务!如有侵权或有涉及法律问题请联系我们。
举报
评论区(1)
按点赞数排序
用户头像