Below is my code, all variables are defined in the above cells in my Jupyter notebook, it. Viewed 3 times 0 New Save questions or answers and organize your favorite content. How to print webmap extent in ArcGis Python API Ask Question Asked today. Layer extent in c/s of dataSource: -6047698.3142 -1568756.4536 2122393.9964 4372931.5431 NaN NaN NaN NaN 1 Answer Sorted by: 1 WebMap does not have a fullExtent property, so that is not going to work. Help Center Detailed answers to any questions you might have. LayerList = (mxd)Īrcpy.AddMessage ("layer name: " + layer.name)Īrcpy.AddMessage ("layer extent in c/s of dataFrame: " + str(layer.getExtent()))ĭescDS = arcpy.Describe (layer.dataSource)Īrcpy.AddMessage ("layer extent in c/s of dataSource: " + str(descDS.extent)) MapPath = arcpy.GetParameterAsText (0) # Test1.mxd There is one layer with a projected coordinate system 'North_America_Equidistant_Conic' containing linear units of meters. Remove service Remove this user added service from the map. Zoom to visible scale Zoom the map to a scale where the layer is visible. Procedureīelow is an example script to be run from a toolbox, where the input parameter is a map named 'Test1.' The data frame in this map has a geographic coordinate system 'GCS_North_American_1983' with angular units of degrees. Zoom to full extent Zoom the map to the full extent of the layer. In that case, use the ArcPy Describe object to obtain the extent property relative to the layer's data source. However, it might be necessary to obtain the layer extents in the unit of the layer's coordinate system. Calling the ArcPy method 'getExtent' on a map layer returns the layer extents expressed in the units of the data frame's coordinate system. If the coordinate system of the map data frame is different from that of the layer, the layer is reprojected dynamically to the coordinate system of the data frame. If a feature layer has a coordinate system, the coordinate system is obtained from the layer's data source. This article discusses ways to obtain the extents of features in a map layer using Python scripting. How To: Use ArcPy to obtain the extents of features in a map layer Summary
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |