• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

gisoracle

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

View Post

arcgis python 使用光标和内存中的要素类将数据加载到要素集 学习:http://zhihu.esrichina.com.cn/article/634

学习:http://zhihu.esrichina.com.cn/article/634
使用光标和内存中的要素类将数据加载到要素集
import arcpy arcpy.env.overwriteOutput = True arcpy.ImportToolbox("http://flame7/arcgis/services;BufferByVal", "servertools") # List of coordinates coordinates = [[-117.196717216, 34.046944853], [-117.186226483, 34.046498438], [-117.179530271, 34.038016569], [-117.187454122, 34.039132605], [-117.177744614, 34.056765964], [-117.156205131, 34.064466609], [-117.145491191, 34.068261129], [-117.170825195, 34.073618099], [-117.186784501, 34.068149525], [-117.158325598, 34.03489167]] # Create an in_memory feature class to initially contain the coordinate pairs feature_class = arcpy.CreateFeatureclass_management( "in_memory", "tempfc", "POINT")[0] # Open an insert cursor with arcpy.da.InsertCursor(feature_class, ["SHAPE@XY"]) as cursor: # Iterate through list of coordinates and add to cursor for (x, y) in coordinates: cursor.insertRow([(x, y)]) # Create a FeatureSet object and load in_memory feature class feature_set = arcpy.FeatureSet() feature_set.load(feature_class) results = arcpy.BufferPoints_servertools(feature_set)

 

posted on 2019-09-30 19:03  gisai  阅读(440)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3