首页 > 其他分享 >[915] Implementation of zooming to layer and exporting to PDF in arcpy

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

时间:2023-10-20 09:55:06浏览次数:42  
标签:lyt layer Implementation project zooming file arcpy aprx

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 the project
aprx = arcpy.mp.ArcGISProject(project_file)

# get the sitebuffer layer
m = aprx.listMaps()[0]
lyr = m.listLayers()[3]

# get the Map element of the layout
lyt = aprx.listLayouts()[0]
mf = lyt.listElements()[-1]

# set the extent to the sitebuffer layer's extent
mf.camera.setExtent(mf.getLayerExtent(lyr, False, True))

# export to PDF
lyt.exportToPDF(lyt.name)
    
del aprx

 

标签:lyt,layer,Implementation,project,zooming,file,arcpy,aprx
From: https://www.cnblogs.com/alex-bn-lee/p/17776353.html

相关文章

  • HarmonyOS音频开发指导:使用AVPlayer开发音频播放功能
    如何选择音频播放开发方式在HarmonyOS系统中,多种API都提供了音频播放开发的支持,不同的API适用于不同音频数据格式、音频资源来源、音频使用场景,甚至是不同开发语言。因此,选择合适的音频播放API,有助于降低开发工作量,实现更佳的音频播放效果。● AVPlayer:功能较完善的音频、视频播放......
  • 易语言利用ckplayer写m3u8看片神器随聊
    也不知道什么时候开始,现在视频网站都是用m3u8格式,而且我对这个格式也不了解。不过,是真的不错,以前你想拖动看(拖着看爽),需要等视频前面都加载好,加载到你这里才能看。现在好了,m3u8因为是切片播放的,它只加载你拖动到的那一小节即可播放,确实先进不少。其实据我观察,现在大部分主流......
  • [908] Implementation of the progress bar in Python
    YoucanimplementaprogressbarinPythontovisuallyrepresenttheprogressofataskusingvariouslibraries.Onecommonlyusedlibraryforthispurposeistqdm.Here'showtousetqdmtocreateasimpleprogressbar:First,youneedtoinstall......
  • 关于流媒体播放器EasyPlayer和EasyPlayerPro的介绍以及其区别
    EasyPlayer是一款流媒体播放器系列项目,它支持多种流媒体协议的播放,包括但不限于RTSP、RTMP、HTTP、HLS、UDP、RTP、File等。除此之外,EasyPlayer还支持本地文件播放和多种功能特性,包括本地抓拍、本地录像、播放旋转、多屏播放、倍数播放等。EasyPlayer核心基于ffmpeg,稳定、......
  • 使用开源播放器VLC media player进行视频格式转换
    VLC是一款自由、开源的跨平台多媒体播放器及框架,可播放大多数多媒体文件,以及DVD、音频CD、VCD及各类流媒体协议。---摘自官网一般用它来播放视频,但其实它也可以转换视频.虽然官网没有明说,我估计转换功能是调用了大佬程序员 法布里斯•贝拉(FabriceBellard)的开源项目FFmpe......
  • android studio配置 compileOnly、implementation、api使用
    implementation:作用是编译同时打包,且当前mudule打包的aar或jar,不能被引用当前module的模块引用。api:作用是编译同时打包,且当前mudule打包的aar或jar,能被引用当前module的模块引用。compileOnly:作用是只编译不打包。比如项目中要引用aarA,如果项目中其他模块已经引用打包过了......
  • 使用 QuickTime Player 将手机投屏到旧版 Macbook pro
    由于旧版的MacBookPro不支持AirPlay,我们可以通过Mac系统自带的应用程序【QuickTimePlayer】来进行投屏操作。以下是具体的步骤:首先,使用USB数据线将你的iPhone和Mac连接起来。此时,手机屏幕上会出现一个是否信任此电脑的提示,你应当选择信任。接着,在Mac的菜单栏中......
  • leaflet | GridLayer扩展土层
    一、createtile方法1、同步使用要创建自定义层,请扩展GridLayer并实现createTile()方法,该方法将通过一个带有x、y和z(缩放级别)坐标的点对象来绘制瓦片。代码示例:varCanvasLayer=L.GridLayer.extend({createTile:function(coords){//createa<canvas>elem......
  • Bugslayer's Tips (zz)
    Bugslayer'sTips AttheendofallmyBugslayercolumnsinMSDNMagazine(andpreviouslyMicrosoftSystemsJournal),Ihaveincludedacoupleoftips.Whilenumerousfolkshaveaskedforthecompletecollection,I'dneverhadtheminoneplace.......
  • JavaScript Library – YouTube Embedded、YouTube Player API、YouTube Data API
    YouTube EmbedVideo参考: Embedvideos&playlists它和 GoogleMapsEmbed 类似,是通过iframe完成的。<iframewidth="800"style="aspect-ratio:16/9"src="https://www.youtube.com/embed/vEZCoe9GJFk"title="粉色海洋"......