我的github
posts - 3243,  comments - 42,  views - 158万

 

 https://blog.csdn.net/u010608964/article/details/90607353

https://desktop.arcgis.com/zh-cn/arcmap/latest/analyze/arcpy-mapping/datadrivenpages-class.htm

对Table的查询:

 

获取Table地址:C:\Users\Administrator\Downloads\jiangyin-统一属性2\jiangyin-2020-12-10.gdb\雨水_

游标Cursor:

https://blog.csdn.net/haichao062/article/details/8109427

https://www.cnblogs.com/hwd9654/p/5682217.html

>>> with arcpy.da.SearchCursor("雨水_",["管段编码","上游井编号"]) as cursor:
...     for row in cursor:
...         if(row[0].find("Y0000726-Y0000728")!= -1):
...             print(row[0])
...             
Y0000726-Y0000728
>>> 

问题代码:

复制代码
def Cal(value):
  if(value is null):
    with arcpy.da.SearchCursor("污水$",["管段编码","管材"]) as cursor:
      for row in cursor:
        if(row[0].find(value)!= -1):
          return row[1]
  else if(value is not null):
    return value
  else:
    return 0
复制代码

空字符串:https://blog.csdn.net/Elephantpretty/article/details/110529584   https://www.cnblogs.com/clarenceyang/p/9681653.html

正确:

def Cal(value):
  if(value==None):
    with arcpy.da.SearchCursor("雨水$",["管段编码","上游井编号"]) as cursor:
      for row in cursor:
        if(row[0].find(value)!= -1):
          return row[1]
  else:
    return value

arcpy 属性修改

 

posted on   XiaoNiuFeiTian  阅读(823)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
历史上的今天:
2019-10-22 cvtColor
2018-10-22 逆向工程(摄影测量)
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示