当前位置:网站首页>Arcpy -- use of insertlayer() function: adding layers to map documents
Arcpy -- use of insertlayer() function: adding layers to map documents
2022-06-26 13:10:00 【YuanYWRS】
【 Statement 】: The code and data of this book come from 【 be based on arcgis Of python Programming tips 】.
【 Ideas 】:insertlayer() Function can be used to add and insert data into a certain position of the layer , It requires a reference layer to specify the location , The new layer will be added above or below the specified reference layer .
【 Be careful 】:InsertLayer() The function requires a reference layer , Use this function for all data frames that cannot be empty .
【 operation 】:

>>> import arcpy.mapping as mapping # Used to import arcpy.mapping modular
>>> mxd=mapping.MapDocument("CURRENT") # Reference the current map document , Assign this reference to a variable
>>> df=mapping.ListDataFrames(mxd,"Crime")[0] # Get right Crime( Current document ) Data frame reference .
>>> refLayer=mapping.ListLayers(mxd,"Burglaries*",df)[0] # Define reference layers
>>> insertLayer=mapping.Layer(r"D:\ To store temporarily \ArcpyBook\data\CityOfSanAntonio.gdb\Crimes2009") # Defines the insertion layer relative to the reference layer
>>> mapping.InsertLayer(df,refLayer,insertLayer,"BEFORE") # Adding layers to a data frame
>>>
【 Result display 】:
边栏推荐
- Verilog中的系统任务(显示/打印类)--$display, $write,$strobe,$monitor
- postgis计算角度
- Analysis and protection of heart blood dripping vulnerability (cve-2014-0160)
- Unit practice experiment 8 - using cmstudio to design microprogram instructions based on basic model machine (1)
- Source code learning: atomicinteger class code internal logic
- 解中小企业之困,百度智能云打个样
- Processing random generation line animation
- Electron official docs series: Best Practices
- 原型模式(prototype)
- Electron official docs series: Get Started
猜你喜欢

MariaDB study notes

Record a phpcms9.6.3 vulnerability to use the getshell to the intranet domain control

第01章_Linux下MySQL的安装与使用

5月产品升级观察站

Photoshop 2022 23.4.1增加了哪些功能?有知道的吗

scrapy——爬取漫画自定义存储路径下载到本地

倍福PLC选型--如何看电机是多圈绝对值还是单圈绝对值编码器

Enjoy element mode (flyweight)

Script - crawl the customized storage path of the cartoon and download it to the local

Bridge mode
随机推荐
黑马笔记---常用API
KVM video card transparent transmission -- the road of building a dream
Lightflow completed the compatibility certification with "daocloud Enterprise Cloud native application cloud platform"
桥接模式(Bridge)
Deep parsing MySQL binlog
P5733 [deep foundation 6. example 1] automatic correction
HDU1724[辛普森公式求积分]Ellipse
HDU 3709 Balanced Number
利用scrapy爬取句子迷网站优美句子存储到本地(喜欢摘抄的人有福了!)
解中小企业之困,百度智能云打个样
装饰器(Decorator)
C# 结构体:定义、示例
Vivado 错误代码 [DRC PDCN-2721] 解决
Design of four kinds of linear phase FIR filters -- complete set of Matlab source code
The El form item contains two inputs. Verify the two inputs
Copy multiple Excel files and name them different
倍福PLC基于CX5130实现数据的断电保持
Electron official docs series: Development
外观模式(Facade)
首批通过!百度智能云曦灵平台获信通院数字人能力评测权威认证