Can you check it out and let me know if this is accurate? If I am missing something? # -*- coding: utf-8 -*-ĭBO_Parcels_Layer_2_ = arcpy.management. I apologize but I am not a pro at programming. # Process: Calculate Geometry Attributes (Calculate Geometry Attributes) (management)ĭBO_Parcels_Layer_2_ = (in_features=DBO_Parcels_Layer, geometry_property=], length_unit="", area_unit="ACRES", coordinate_system="PROJCS],PRIMEM,UNIT],PROJECTION,PARAMETER,PARAMETER,PARAMETER,PARAMETER,PARAMETER,UNIT]", coordinate_format="SAME_AS_INPUT") Our data is branch versioned and hosted on an enterprise portal. With arcpy.EnvManager(scratchWorkspace=r"C:\Users\abishop\AppData\Local\Temp\ArcGISProTemp8392\0686a1b7-5a62-4965-97f7-463b179295c6\Default.gdb", workspace=r"C:\Users\abishop\AppData\Local\Temp\ArcGISProTemp8392\0686a1b7-5a62-4965-97f7-463b179295c6\Default.gdb"):Ī(in_features=mcpagis_DBO_Parcels, out_layer=DBO_Parcels_Layer, where_clause="GIS_ACRES = 0 Or GIS_ACRES IS NULL", workspace="", field_info="OBJECTID OBJECTID VISIBLE NONE PARCEL PARCEL VISIBLE NONE PREFIX PREFIX VISIBLE NONE SUFFIX1 SUFFIX1 VISIBLE NONE SUFFIX2 SUFFIX2 VISIBLE NONE GIS_ACRES GIS_ACRES VISIBLE NONE KIND KIND VISIBLE NONE ANGLE ANGLE VISIBLE NONE SIZE_ SIZE_ VISIBLE NONE DATE_CREATED DATE_CREATED VISIBLE NONE DATE_UPDATED DATE_UPDATED VISIBLE NONE SHAPE SHAPE VISIBLE NONE SHAPE.area SHAPE.area VISIBLE NONE SHAPE.len SHAPE.len VISIBLE NONE") Good Morning, I am trying to calculate geometry attributes (polygon extents, point centroids, areas etc) on a feature service hosted in our stand alone portal using notebooks and the ArcGIS API for Python. # Process: Make Feature Layer (Make Feature Layer) (management) Mcpagis_DBO_Parcels = "K:\\GIS_TOOLS\\DB\\merlin.sde\\_Features\\" With arcpy.EnvManager(scratchWorkspace=r"C:\Users\abishop\AppData\Local\Temp\ArcGISProTemp10544\1ba0f558-c873-4c6c-be6d-dc08393016c0\Default.gdb", workspace=r"C:\Users\abishop\AppData\Local\Temp\ArcGISProTemp10544\1ba0f558-c873-4c6c-be6d-dc08393016c0\Default.gdb"): Use the following steps to calculate geometry: Expand the dataset for which you will calculate feature size. # To allow overwriting outputs change overwriteOutput option to True.Īrcpy.ImportToolbox(r"c:\program files\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx") Generated by ArcGIS ModelBuilder on : 10:58:27 Any suggestions on how to accomplish this? Any help will be greatly appreciated! See the model's python code below. The only problem I am facing now is that when I check the feature class and the newly calculated acreage, it is a decimal with 6 decimal places. I have been working on a model that makes a feature layer based on a selection criteria then calculates the geometry attributes of that feature layer's acreage field. Use this to save a layer after joining an attribute table.I am using ArcGIS Pro 2.8.2 Model Builder. This however is only a temporary file, so export this temporary point file to a geodatabase or shapefile (right click on layer, Data>Export data…) The points of the polygon centroids should now be displayed.Identify the x, and y fields, and the coordinate system. Right-click on the table in the Table of Contents, and select ‘display x,y, coordinates’. Under the table menu (the icon is located in the top left-hand corner of the table), select ‘Export…’ and save the table (I generally save in text/csv format).Stop, close, restart AND try on another file. It handles adding the fields, in case there is some issue there. carefully selecting the things your want including you length, area units and the coordinate system. Geometry Operations with ArcMap Field Calculator Field Calculator is one of the most frequently used tools within ArcMap: taught as part of nearly every introductory GIS course, it offers spreadsheet-like features to the normally static attribute table. geometries is returned as a list of geometry objects. Still in the table view right click on the field name ‘x’ and select “Calculate Geometry…”. Under Property select ‘X Coordinate of Centroid’ and select the appropriate Coordinate System and Units. Add Geometry AttributesData Management toolbox Documentation. import arcpy Run the Copy Features tool, setting the output to the geometry object.Open the table of the Polygon layer and add 2 new fields called ‘x’ and ‘y’. Make sure the type is ‘double’ or at least ‘long integer’.Here is one example of converting polygon centroids to points (the Polygon to Point tool requires the advanced license). During my time in University I got used to the luxury of having the Advanced (formerly ArcInfo) ESRI license. Since then I have found that there are often ways to do the same tasks with lower licenses but in a couple more steps.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |