shrug-l: Zoom map to the extent of a layer in Arcpy.mp

Janelle Versnick Janelle.Versnick at citizensfla.com
Fri Jun 2 14:30:22 EDT 2017


I would check this link out. https://urldefense.proofpoint.com/v2/url?u=http-3A__pro.arcgis.com_en_pro-2Dapp_arcpy_mapping_mapframe-2Dclass.htm&d=DwIGaQ&c=-Q2oFtSeUeVdqcGrCCygxt6LResmVl0POOzRQwCZt0Q&r=aNZ9lp6i9zhj5X7oFQ0qEznSr2AZneWH7-pXUMvi_wI&m=lF-oFnOD2xuz_uMNkTsyV6584_2MwliPavGjY41dOZU&s=rnfEr1Buc_5drFTXl6RiJVyC2_m8BuXeGU7ouv9-wFg&e= 

getLayerExtent (layer, {selection_only}, {symbolized_extent})

Returns a layer's extent for all features or only the selected features in a layer.

panToExtent (extent)

Pans and centers the MapFrame using a new Extent<https://urldefense.proofpoint.com/v2/url?u=http-3A__pro.arcgis.com_en_pro-2Dapp_arcpy_classes_extent.htm&d=DwIGaQ&c=-Q2oFtSeUeVdqcGrCCygxt6LResmVl0POOzRQwCZt0Q&r=aNZ9lp6i9zhj5X7oFQ0qEznSr2AZneWH7-pXUMvi_wI&m=lF-oFnOD2xuz_uMNkTsyV6584_2MwliPavGjY41dOZU&s=_MVc5MUULW79fD3Ky5MPaB4Sqn4r_Sa8rlt_Q1sys-U&e= > object without changing the map frame's scale.

zoomToAllLayers ({selection_only}, {symbolized_extent})

Modifies the MapFrame view to match the extent of all layers or selected layers in a map.




Janelle Versnick, GISP | Data Science Analyst
Corporate Analytics
Citizens Property Insurance Corporation

Office: 850-521-8373
Email: Janelle.Versnick at Citizensfla.com<mailto:Janelle.Versnick at Citizensfla.com>




From: SHRUG-L [mailto:shrug-l-bounces at lists.dep.state.fl.us] On Behalf Of Jeff Reed
Sent: Friday, June 02, 2017 1:53 PM
To: Pollock, William H. (Bill) <William.H.Pollock at dep.state.fl.us>
Cc: shrug-l at lists.dep.state.fl.us
Subject: Re: shrug-l: Zoom map to the extent of a layer in Arcpy.mp


[Caution: This email was received from a source outside of the Citizens network. DO NOT enable macros if an attached document asks you to. DO NOT open attachments or click on any link if this email seems suspicious in any way, especially if it appears to come from a Citizens email address.]

________________________________
Doh!

Sorry, I didn't read that close........I have no clue there.

On Fri, Jun 2, 2017 at 12:48 PM, Pollock, William H. (Bill) <William.H.Pollock at dep.state.fl.us<mailto:William.H.Pollock at dep.state.fl.us>> wrote:
Thanks Jeff –

But those apply to ArcGIS Desktop and ArcPy.mapping.

Looking for the equivalents in ArcGIS Pro and ArcPy.mp.

Thanks again.
+ bill


William Pollock, GISP
Kyra Solutions, Inc.
FL Department of Environmental Protection
850.245.2722 ext. 4722<tel:(850)%20245-2722>

From: Jeff Reed [mailto:fsu1jreed at gmail.com<mailto:fsu1jreed at gmail.com>]
Sent: Friday, June 2, 2017 1:46 PM
To: Pollock, William H. (Bill) <William.H.Pollock at dep.state.fl.us<mailto:William.H.Pollock at dep.state.fl.us>>
Cc: shrug-l at lists.dep.state.fl.us<mailto:shrug-l at lists.dep.state.fl.us>
Subject: Re: shrug-l: Zoom map to the extent of a layer in Arcpy.mp

Yes there is.

There's the getSelectedExtent method for a Layer<https://urldefense.proofpoint.com/v2/url?u=http-3A__help.arcgis.com_en_arcgisdesktop_10.0_help_index.html-23_Layer_00s300000008000000_&d=DwMFaQ&c=-Q2oFtSeUeVdqcGrCCygxt6LResmVl0POOzRQwCZt0Q&r=GfXm_0cGNALcMRxuv-vn0uj-kFhEBpjZgO__QGBECXQ&m=vf4cnicgR4Wp7uh-T3ubdUgXCAvRvxrGLnYHcbb3ruA&s=nwO25UMPj5Z_VO7tXebBS4VtSMmTshJb6383VIKS228&e=>:
•  getExtent ({symbolized_extent}) - Returns a layer's geometric or symbolized extent
•  getSelectedExtent ({symbolized_extent}) - Returns a layer's geometric or symbolized extent for selected features
A getSelectedExtent method <https://urldefense.proofpoint.com/v2/url?u=http-3A__help.arcgis.com_en_arcgisdesktop_10.0_help_index.html-23_DataFrame_00s300000003000000_&d=DwMFaQ&c=-Q2oFtSeUeVdqcGrCCygxt6LResmVl0POOzRQwCZt0Q&r=GfXm_0cGNALcMRxuv-vn0uj-kFhEBpjZgO__QGBECXQ&m=vf4cnicgR4Wp7uh-T3ubdUgXCAvRvxrGLnYHcbb3ruA&s=j9pnUzHE7gWb1kUv7UEUTTlohqlAId2I6b7rXga5vQQ&e=> Dataframe<https://urldefense.proofpoint.com/v2/url?u=http-3A__help.arcgis.com_en_arcgisdesktop_10.0_help_index.html-23_DataFrame_00s300000003000000_&d=DwMFaQ&c=-Q2oFtSeUeVdqcGrCCygxt6LResmVl0POOzRQwCZt0Q&r=GfXm_0cGNALcMRxuv-vn0uj-kFhEBpjZgO__QGBECXQ&m=vf4cnicgR4Wp7uh-T3ubdUgXCAvRvxrGLnYHcbb3ruA&s=j9pnUzHE7gWb1kUv7UEUTTlohqlAId2I6b7rXga5vQQ&e=>:
•  panToExtent (extent) - Pans and centers the data frame extent using a new Extent object without changing the data frame's scale
•  zoomToSelectedFeatures () - Changes the data frame extent to match the extent of the currently selected features for all layers in a data frame
Plus you can try these:
•  df.zoomToSelectedFeatures() - will zoom to the extents of the data frame to all selected features in the map frame
•  lyr.getSelectedExtent() - will zoom to to a selection set for a specific layer

On Fri, Jun 2, 2017 at 9:48 AM, Pollock, William H. (Bill) <William.H.Pollock at dep.state.fl.us<mailto:William.H.Pollock at dep.state.fl.us>> wrote:
Howdy SHRUG –

Anyone find a way to “zoom Map to the extent of a layer in Arcpy.mp” ?

There are many scenarios where this basic function, zooming to a layer or a selection, would be used, right ?

Zoom map to the extent of a layer in Arcpy.mp (May 02, 2017)
https://urldefense.proofpoint.com/v2/url?u=https-3A__geonet.esri.com_thread_194310-2Dzoom-2Dmap-2Dto-2Dan-2Dlayer-2Din-2Darcpymp-2Darcgis-2Dpro-2Dproject&d=DwIGaQ&c=-Q2oFtSeUeVdqcGrCCygxt6LResmVl0POOzRQwCZt0Q&r=aNZ9lp6i9zhj5X7oFQ0qEznSr2AZneWH7-pXUMvi_wI&m=lF-oFnOD2xuz_uMNkTsyV6584_2MwliPavGjY41dOZU&s=eJHXbZG3eIlEDzsqSQFM2gVYXNjzs0IG7bLQAZ8tPHs&e= <https://urldefense.proofpoint.com/v2/url?u=https-3A__geonet.esri.com_thread_194310-2Dzoom-2Dmap-2Dto-2Dan-2Dlayer-2Din-2Darcpymp-2Darcgis-2Dpro-2Dproject&d=DwMFaQ&c=-Q2oFtSeUeVdqcGrCCygxt6LResmVl0POOzRQwCZt0Q&r=GfXm_0cGNALcMRxuv-vn0uj-kFhEBpjZgO__QGBECXQ&m=vf4cnicgR4Wp7uh-T3ubdUgXCAvRvxrGLnYHcbb3ruA&s=Dbvdapvpdz7Fl1shyCd-vtADFpwQomk2Uz9mPkQ--I8&e=>

Choosing and zooming to features using SQL query in ArcPy with ArcGIS Pro? (Dec 14, 2015)
https://urldefense.proofpoint.com/v2/url?u=https-3A__gis.stackexchange.com_questions_173687_choosing-2Dand-2Dzooming-2Dto-2Dfeatures-2Dusing-2Dsql-2Dquery-2Din-2Darcpy-2Dwith-2Darcgis-2Dpro&d=DwIGaQ&c=-Q2oFtSeUeVdqcGrCCygxt6LResmVl0POOzRQwCZt0Q&r=aNZ9lp6i9zhj5X7oFQ0qEznSr2AZneWH7-pXUMvi_wI&m=lF-oFnOD2xuz_uMNkTsyV6584_2MwliPavGjY41dOZU&s=knPe2xiid08zN3Y4S_BQ6b0CI3gmVG5j2C7AA9bFarg&e= <https://urldefense.proofpoint.com/v2/url?u=https-3A__gis.stackexchange.com_questions_173687_choosing-2Dand-2Dzooming-2Dto-2Dfeatures-2Dusing-2Dsql-2Dquery-2Din-2Darcpy-2Dwith-2Darcgis-2Dpro&d=DwMFaQ&c=-Q2oFtSeUeVdqcGrCCygxt6LResmVl0POOzRQwCZt0Q&r=GfXm_0cGNALcMRxuv-vn0uj-kFhEBpjZgO__QGBECXQ&m=vf4cnicgR4Wp7uh-T3ubdUgXCAvRvxrGLnYHcbb3ruA&s=8tAAmBXAjV-AXN_yUIUD4yOd_5PSDDfTUC7rBlfwA7k&e=>

Thank you and cheers,
+ bill

William Pollock, GISP
Kyra Solutions, Inc.
FL Department of Environmental Protection
850.245.2722 ext. 4722<tel:(850)%20245-2722>


_______________________________________________
SHRUG-L mailing list
SHRUG-L at lists.dep.state.fl.us<mailto:SHRUG-L at lists.dep.state.fl.us>
https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.dep.state.fl.us_mailman_listinfo_shrug-2Dl&d=DwIGaQ&c=-Q2oFtSeUeVdqcGrCCygxt6LResmVl0POOzRQwCZt0Q&r=aNZ9lp6i9zhj5X7oFQ0qEznSr2AZneWH7-pXUMvi_wI&m=lF-oFnOD2xuz_uMNkTsyV6584_2MwliPavGjY41dOZU&s=QZIy8oTWt5kO5CbvpssDjIJ-Q5sBGzRVLRwMQAIZUo0&e= <https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.dep.state.fl.us_mailman_listinfo_shrug-2Dl&d=DwMFaQ&c=-Q2oFtSeUeVdqcGrCCygxt6LResmVl0POOzRQwCZt0Q&r=GfXm_0cGNALcMRxuv-vn0uj-kFhEBpjZgO__QGBECXQ&m=vf4cnicgR4Wp7uh-T3ubdUgXCAvRvxrGLnYHcbb3ruA&s=OLdd64t4fPtBMyC_6P0ePwXYNrKPAELnsYNahr1Gmoc&e=>



--
Jeff Reed
GIS Analyst/ECUA
Adjunct Professor/Delta State University

[Dep Customer Survey]<https://urldefense.proofpoint.com/v2/url?u=http-3A__survey.dep.state.fl.us_-3Frefemail-3DWilliam.H.Pollock-40dep.state.fl.us&d=DwMFaQ&c=-Q2oFtSeUeVdqcGrCCygxt6LResmVl0POOzRQwCZt0Q&r=GfXm_0cGNALcMRxuv-vn0uj-kFhEBpjZgO__QGBECXQ&m=vf4cnicgR4Wp7uh-T3ubdUgXCAvRvxrGLnYHcbb3ruA&s=qt6_78-doAQAJEJZNe1OnN71s87eEYNLV7K3y76zlWY&e=>



--
Jeff Reed
GIS Analyst/ECUA
Adjunct Professor/Delta State University

This email and any attachments may contain confidential and privileged information and are solely for the use of the intended recipient(s). If you have received this email in error, please notify the sender immediately, and delete the original message. If you are not the intended recipient, please do not use, disclose, disseminate or distribute this email or any information contained in this email. Please be advised that emails are subject to the Florida Public Records Act, and any response to this email may be a public record.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dep.state.fl.us/pipermail/shrug-l/attachments/20170602/c636f7f4/attachment.html>


More information about the SHRUG-L mailing list