arcpy

使用arcpy向server端发布服务

import arcpy import os # Set output file names outdir = r"D:" service = "MapImageSharingDraftExample" mapname = "" sddraft_filename = service + ".sddr ......
server arcpy

Arcpy使用入门

2.7Python(目前ArcGIS使用)代码转化为3.5Python(目前ArcGIS Pro使用)代码 Analyze Tools For Pro (2to3命令) 基本操作 调用ArcToolbox的两种形式 #arcpy.ToolboxAlias.ToolName() #arcpy.Tool ......
Arcpy

[933] In ArcPy, how to get the geometry of a feature from a shapefile

In ArcPy, you can get the geometry of a feature from a shapefile using the SearchCursor or UpdateCursor and the SHAPE@ token to access the geometry of ......
shapefile geometry feature ArcPy from

[932] In ArcPy, how to get the extent of a shapefile

In ArcPy, you can get the extent of a shapefile using the Describe function and the extent property. Here's how you can do it: import arcpy # Set the ......
shapefile extent ArcPy 932 how

[931] arcpy - buffer, delete shp and rename shp

The script is as follows: arcpy.analysis.Buffer("siteboundary.shp","siteboundary1.shp","-5 Centimeters","FULL","ROUND","NONE",None,"GEODESIC") arcpy.m ......
shp buffer delete rename arcpy

[930] arcpy - change spatial reference, zoom to layer and export to PDF

The general idea is as follows: aprx -> layout -> map -> layer -> extent layout -> setExtent layout -> exportToPDF The script is as follows: def expor ......
reference spatial change export arcpy

【ArcPy】Python工具的参数校验

在updateMessages方法中检查输入图层数据源的工作空间是否是本地数据,如果不是,设置错误。在updateParameters方法中从图层派生出第4个参数,即输出要素类的路径。注意该参数的类型需要是“派生(Derived)” import arcpy class ToolValidator( ......
参数 工具 Python ArcPy

Arcpy | NetCDF转栅格(投影3857)

# -*- coding: utf-8 -*- import arcpy import os def NcToRaster(ncFile, workspace=None): if workspace is None: workspace = os.path.dirname(ncFile) arcpy ......
栅格 NetCDF Arcpy 3857

Arcpy删除栅格图层

要使用arcpy删除栅格图层,可以使用Delete_management()函数。 import arcpy # 设置工作空间 arcpy.env.workspace = "D:/data" # 定义要删除的栅格图层名称 raster_layer = "example_raster.tif" # 删 ......
栅格 Arcpy

[924] ArcGIS Pro Mapping Module - arcpy.mp

ref: Introduction to arcpy.mp ref: Getting started with arcpy.mp tutorial ref: Guidelines for arcpy.mp ref: Alphabetical list of arcpy.mp functions re ......
Mapping ArcGIS Module arcpy 924

[915] Implementation of zooming to layer and exporting to PDF in arcpy

ref: Camera - ArcGIS Pro ref: Introduction to arcpy.mp # Set the path to your project file (.aprx) project_file = r"Map 1.3 Heritage.aprx" # Reference ......
Implementation exporting zooming layer arcpy

[894] Optimize arcpy scripts

ref: Parallel Processing Factor (Environment setting) ref: Write geoprocessing output to memory Parallel processing arcpy.env.parallelProcessingFactor ......
Optimize scripts arcpy 894

[889] To enable arcpy in VS Code

To enable arcpy in VS Code, you need to configure your Python interpreter to use the ArcGIS Pro Python environment. Here are some steps you can follow ......
enable arcpy Code 889 To

[886] Some useful functions in ArcPy

Exists: Determines the existence of the specified data object. This function tests for the existence of various data types including feature classes, ......
functions useful ArcPy Some 886

[879] Run stand-alone scripts of arcpy

Ref: Run stand-alone scripts plain paste in Windows: shift+ctrl+V How do I run a stand-alone script? In other ArcGIS products, a Python script is run ......
stand-alone scripts stand alone arcpy

ArcMap+ArcPy 图层样式批量设置

originLayerName = "" mxd = arcpy.mapping.MapDocument(r"CURRENT") originLayer = arcpy.mapping.ListLayers(mxd, originLayerName)[0] layers = arcpy.mappin ......
样式 ArcMap ArcPy

ArcPy批量对大量遥感影像相减做差

本文介绍基于**Python**中**ArcPy**模块,对大量栅格遥感影像文件**批量**进行**相减做差**的方法。 首先,我们来明确一下本文的具体需求。现有一个存储有多张`.tif`格式遥感影像的文件夹,其中每一个遥感影像的文件名中都包含有该图像的成像年份,且每一个遥感影像的空间范围、像元大小 ......
遥感 影像 ArcPy

课本_第二章、arcpy开发入门

八股文--判断文件是否存在 1 result = ap.Exists(文件路径) # 返回布尔值 2 print result 八股文--获取.shp文件中矢量要素数量(属性表的行数) 参考连接:Result—ArcMap | 文档 (arcgis.com) 1 count = ap.GetCoun ......
课本 第二章 arcpy

ArcPy 批处理之 [ 批量采样栅格属性值构建箱型图(BoxPlot)的数据准备]

将单幅栅格影像的属性值参与到箱型图中的一个Box中,考虑像元数量过多,进行1%或者0.5%采样,此处额外统计最小值、最大值、均值和中位数。 ArcPy 代码(此处为3.x 版本,与Python2.7 存在差异): #encoding:utf-8 import os import arcpy from ......
栅格 属性 BoxPlot 数据 ArcPy

使用arcpy替换工程文件中的栅格图层数据源异常

参考:https://www.cnblogs.com/Leechg/p/10668992.html 前面的1月1日到1月31日输出正常 但是从2月1日开始就开始重复输出1月1日的图片 到3月1日开始也是输出1月1日的图片。。 难道每个月的必须分开存放?原因是??? ......
栅格 数据源 文件 数据 工程

Python ArcPy批量计算多时相遥感影像的各项元平均值

本文介绍基于Python中ArcPy模块,对大量长时间序列栅格遥感影像文件的每一个像元进行多时序平均值的求取。 在遥感应用中,我们经常需要对某一景遥感影像中的全部像元的像素值进行平均值求取——这一操作很好实现,基于ArcMap软件或者简单的Python代码就可以实现;但有时候,我们会需要结合同一地区 ......
均值 遥感 影像 Python ArcPy

ArcPy 批处理之 [ hdf转tif ]; [ Con函数 ]; 镶嵌至新栅格 [ Mosaic to New Raster ]; 重投影[ Reproject ]; 按掩膜提取[ Extract by Mask ]; [ 按条件乘积 ]; 以表格显示分区统计[ Zonal Statistics As Table ];汇总属性表

在ArcMap ArcCatalog或ArcGIS Pro中的Python命令行中进行批处理的一些代码:hdf转tif-Con函数-镶嵌至新栅格-重投影-按掩膜提取-按条件乘积-以表格显示分区统计-汇总属性表 等。 ......
掩膜 栅格 乘积 Statistics 函数

【ArcPy】如何在ArcPy创建要素中生成精准的XY坐标?解决精度损失问题

使用ArcPy创建要素的代码段前面有发布,【arcpy】创建点、线、面(孔洞、环、多部件)要素、要素类 Q:这些代码里创建要素后会存在XY精度损失的问题,如何解决? A:解决方案是在创建要素过程中指定正确的空间参考。 答案来自 geometry - How to handle coordinates ......
ArcPy 坐标 精度 要素 损失

arcpy孔洞如何填补

参考:https://blog.csdn.net/weixin_40450867/article/details/85222383 带孔洞的polygon坐标是如何存的?如果没有孔洞,那么polygon的坐标最后一个点和第一个点会重合。如果带孔洞的话,就不重合? ......
孔洞 arcpy

【ArcPy】如何判断工作空间(workspace)的类型(Type)

在使用ArcPy编写toolbox工具场景中,使用workspace类型参数获取要素类存储空间。 这个工作空间的类型可以是文件夹,也可以是gdb、mdb、sde。 判断出工作空间的类型,是命名要素类的前提,因为存储在文件夹的要素类要带有扩展名,即*.shp,而其他工作空间下存储要素类无需扩展名。 使 ......
workspace 类型 ArcPy 空间 Type

【ArcPy】关于VS Code对ArcPy代码补全(auto complete)/智能感知(intelisense)失效问题的解决

昨晚打开VS Code瞎鼓捣,发现代码补全不见了。 软件设置、环境配置…… 上穷碧落下黄泉,一通操作仍不见。 便开始将视线转移到VS Code的支持插件上来,经过分析,认定Pylance这东西的锅。 把它向前还原了两个版本,解决。 ......
ArcPy intelisense complete 代码 智能

Python ArcPy批量掩膜、重采样大量遥感影像

本文介绍基于Python中ArcPy模块,对大量栅格遥感影像文件进行批量掩膜与批量重采样的操作。 首先,我们来明确一下本文的具体需求。现有一个存储有大量.tif格式遥感影像的文件夹;且其中除了.tif格式的遥感影像文件外,还具有其它格式的文件。 我们希望,依据一个已知的面要素矢量图层文件,对上述文件 ......
掩膜 遥感 影像 Python ArcPy

Python ArcPy批量拼接长时间序列栅格图像

本文介绍基于Python中ArcPy模块,对大量不同时相的栅格遥感影像按照其成像时间依次执行批量拼接的方法。 在前期的文章Python arcpy创建栅格、批量拼接栅格中,我们介绍了利用Python实现栅格遥感影像批量拼接的方法;但这篇文章实现的操作是将某个保存路径下全部的栅格图像文件加以拼接,换句 ......
栅格 序列 图像 Python ArcPy

HDF格式遥感影像批量转为TIFF格式:ArcPy实现

本文介绍基于Python中ArcPy模块,实现大量HDF格式栅格图像文件批量转换为TIFF格式的方法。 首先,来看看我们想要实现的需求。 在一个名为HDF的文件夹下,有五个子文件夹;每一个子文件夹中,都存储了大量的.hdf格式的栅格遥感影像数据。 我们在其中任选一个子文件夹,来看看其中所含的文件。 ......
格式 遥感 影像 ArcPy TIFF

Python arcpy创建栅格、批量拼接栅格

本文介绍基于Python语言arcpy模块,实现栅格影像图层建立与多幅遥感影像数据批量拼接(Mosaic)的操作。 首先,相关操作所需具体代码如下: import os import arcpy file_path="G:/Postgraduate/LAI_Glass_RTlab/A2018161_ ......
栅格 Python arcpy
共30篇  :1/1页 首页上一页1下一页尾页