当前位置:网站首页>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 】:
边栏推荐
- 适配器模式(Adapter)
- P2393 yyy loves Maths II
- Fire warning is completed within 10 seconds, and Baidu AI Cloud helps Kunming Guandu build a new benchmark of smart city
- 机器学习笔记 - 时间序列的季节性
- Typescript
- This function has none of deterministic, no SQL solution
- 别乱用 FULL_CASE 和 PARALLEL_CASE
- 外观模式(Facade)
- P5733 【深基6.例1】自动修正
- 装饰器(Decorator)
猜你喜欢

首批通过!百度智能云曦灵平台获信通院数字人能力评测权威认证

倍福EtherCAT Xml描述文件更新和下载

Processsing function random

Software testing - concept

processing 函数translate(mouseX, mouseY)学习

别乱用 FULL_CASE 和 PARALLEL_CASE

装饰器(Decorator)

Fire warning is completed within 10 seconds, and Baidu AI Cloud helps Kunming Guandu build a new benchmark of smart city

倍福NC轴状态转移图解析

To solve the difficulties of small and medium-sized enterprises, Baidu AI Cloud makes an example
随机推荐
J - Wooden Sticks poj 1065
装饰器(Decorator)
Mode pont
National standard gb28181 protocol easygbs video platform TCP active mode streaming exception repair
Processing 多面体变化
Electron official docs series: Distribution
Explain C language 10 in detail (C language series)
详细讲解C语言11(C语言系列)
Design of four kinds of linear phase FIR filters -- complete set of Matlab source code
Angle de calcul POSTGIS
倍福TwinCAT通过Emergency Scan快速检测物理连接和EtherCAT网络
Word document export (using fixed template)
System tasks (display / print class) in Verilog - $display, $write, $strobe, $monitor
tauri vs electron
Script - crawl the customized storage path of the cartoon and download it to the local
Unit practice experiment 8 - using cmstudio to design microprogram instructions based on basic model machine (1)
What should the software test report include? Interview must ask
F - Charm Bracelet
Electron official docs series: Testing And Debugging
Fire warning is completed within 10 seconds, and Baidu AI Cloud helps Kunming Guandu build a new benchmark of smart city