随笔分类 -  ArcPy

ArcGis Python脚本
摘要:将ArcGIS文档版本批量另存为低版本 'C:\Users\Administrator\Desktop\sample'是文档所在的文件夹 'C:\Users\Administrator\Desktop\out'是输出文件夹,它必须是已经存在的 '9.3'是输出版本,具体的在ArcMap看“另存副本” 阅读全文
posted @ 2020-09-21 09:50 yzhyingcool 阅读(949) 评论(0) 推荐(0)
摘要:%.4f"% !JZDYZB!格式化一个4位小数坐标 "坐标(X:%.4f"% !JZDXZB! +",Y:%.4f"% !JZDYZB! +")," + !DWSM! 下面遇到其他情况补写。 阅读全文
posted @ 2020-08-17 12:51 yzhyingcool 阅读(698) 评论(0) 推荐(0)
摘要:转自 https://ernest.me/post/python-setdefaultencoding-unicode-bytes/ sys.setdefaultencoding(‘utf-8’) 曾经(现在依然)是解决中文编码的万能钥匙。解决编码错误问题一劳永逸,从此和 UnicodeEncode 阅读全文
posted @ 2020-07-03 21:09 yzhyingcool 阅读(1390) 评论(0) 推荐(0)
摘要:import arcpy fcs=arcpy.GetParameterAsText(0).split(';') for fc in fcs: fld_name_list= [i.name for i in arcpy.ListFields(fc)] try: if 'NAME' in fld_nam 阅读全文
posted @ 2020-04-02 20:27 yzhyingcool 阅读(1769) 评论(0) 推荐(0)
摘要:受邀研究了一下arcpy生成界址点成果表,如有需要定制工具或源码可以联系作者。 2020年11月补充 实现了一个新的模板,详见ArcGIS生成界址点成果表Excel的主要实现方法(arcpy) - 知乎 (zhihu.com) 以下是原文 工具与结果如下: 主要实现方式 1.通过getPointLi 阅读全文
posted @ 2020-03-29 22:29 yzhyingcool 阅读(3344) 评论(2) 推荐(0)
摘要:with arcpy.da.UpdateCursor(in_table=in_table,field_names=in_field,) as cursor: for row in cursor: guid=str(uuid.uuid1()).upper() if is_upper else str( 阅读全文
posted @ 2020-03-10 16:38 yzhyingcool 阅读(1534) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2020-03-05 15:41 yzhyingcool 阅读(956) 评论(0) 推荐(0)
摘要:Is it possible to sort an arcpy.da.UpdateCursor()? da.UpdateCursor UpdateCursor (in_table, field_names, {where_clause}, {spatial_reference}, {explode_ 阅读全文
posted @ 2020-02-28 18:37 yzhyingcool 阅读(356) 评论(0) 推荐(0)
摘要:对“镶嵌至新栅格”工具做一个小小的补充,使其能够直接对一个文件夹下的栅格进行镶嵌。 # coding=utf-8 import arcpy from arcpy import env rasterFolder=arcpy.GetParameterAsText(0) newRasterName=arc 阅读全文
posted @ 2020-02-16 15:13 yzhyingcool 阅读(2818) 评论(1) 推荐(0)
摘要:插个广告,制作ArcGIS的Tool工具学习下面的教程就对了: 零基础学习Python制作ArcGIS自定义工具观看链接 《零基础学习Python制作ArcGIS自定义工具》课程简介 先将接图表拆分,使每一个图斑为一个要素类。要素类使用图幅号字段命名,名字同栅格。 举个栗子:要素类为sample.s 阅读全文
posted @ 2019-12-13 20:11 yzhyingcool 阅读(606) 评论(0) 推荐(0)
摘要:插个广告,制作ArcGIS的Tool工具学习下面的教程就对了: 零基础学习Python制作ArcGIS自定义工具观看链接 《零基础学习Python制作ArcGIS自定义工具》课程简介 1 import arcpy 2 import numpy 3 from arcpy import da 4 5 d 阅读全文
posted @ 2019-09-23 20:49 yzhyingcool 阅读(1778) 评论(0) 推荐(0)
摘要:import arcpy in_format=arcpy.GetParameterAsText(0) out_format=arcpy.GetParameterAsText(1) out_folder=arcpy.GetParameterAsText(3) arcpy.env.workspace=a 阅读全文
posted @ 2019-09-23 20:45 yzhyingcool 阅读(1062) 评论(0) 推荐(0)
摘要:对比6个常用的字段数据类型在Arcpy字段创建与字段属性输出时奇怪的事情: 添加字段使用arcpy.AddField_management: # addfield 的 type参数 # 浮点型,Float # 长整型,Long # 日期型,Date # 文本型,Text # 短整型,Short # 阅读全文
posted @ 2019-08-28 15:56 yzhyingcool 阅读(1257) 评论(0) 推荐(0)
摘要:mxd = mapping.MapDocument("CURRENT") df = mapping.ListDataFrames(mxd)[0] layer = mapping.Layer(outFcPath) mapping.AddLayer(df, layer, 'Top') arcpy.Add 阅读全文
posted @ 2019-08-20 20:59 yzhyingcool 阅读(996) 评论(0) 推荐(1)
摘要:ArcGis Python脚本——ArcGIS 中使用的 Python 是什么版本 ArcGis Python脚本——批量添加字段 ArcGis Python脚本——批量删除字段 ArcGis Python脚本——根据字段内容拆分要素类(shp)为多个 ArcGis Python脚本——要素图斑自动 阅读全文
posted @ 2019-06-17 22:14 yzhyingcool 阅读(6890) 评论(1) 推荐(1)
摘要:# coding=gbk import arcpy from arcpy import da as da import os def main(): lyr=arcpy.GetParameter(0) areaFld=arcpy.GetParameterAsText(1) areaLimit=arc 阅读全文
posted @ 2019-03-19 21:02 yzhyingcool
摘要:插个广告,制作ArcGIS的Tool工具学习下面的教程就对了: 零基础学习Python制作ArcGIS自定义工具观看链接 《零基础学习Python制作ArcGIS自定义工具》课程简介 有示例要素类如下 经过下面代码处理 1 #遍历输出面或折线要素的折点坐标 2 #infc:输入要素类 # code 阅读全文
posted @ 2019-03-13 22:16 yzhyingcool 阅读(4080) 评论(2) 推荐(1)
摘要:插个广告,制作ArcGIS的Tool工具学习下面的教程就对了: 零基础学习Python制作ArcGIS自定义工具观看链接 《零基础学习Python制作ArcGIS自定义工具》课程简介 年前写了一个用渔网工具制作图幅接图表的文章,链接在这里: 使用ArcMap做一个1:5000标准分幅图并编号 本文提 阅读全文
posted @ 2019-03-06 21:45 yzhyingcool 阅读(4257) 评论(0) 推荐(1)
摘要:插个广告,制作ArcGIS的Tool工具学习下面的教程就对了: 零基础学习Python制作ArcGIS自定义工具观看链接 《零基础学习Python制作ArcGIS自定义工具》课程简介 以下是正文: Python 编程语言用于自 9.0 起的各版本 ArcGIS 中,并被整合到 ArcMap 和 Ar 阅读全文
posted @ 2019-01-15 21:53 yzhyingcool 阅读(6975) 评论(0) 推荐(2)
摘要:先看如何增加一个字段 函数:arcpy.AddField_management 语法:AddFields_management (in_table, field_description) 参数 说明 数据类型 in_table 要添加指定字段的输入表。该字段将被添加到现有输入表,并且不会创建新的输出 阅读全文
posted @ 2019-01-15 21:48 yzhyingcool 阅读(14028) 评论(0) 推荐(2)