![]() ![]() As this is the default for the tool, you dont need to set it as a parameter. Please note how the spatial reference system should have been written: "GCS_WGS_1984". Firstly, the X and Y fields were incorrect. I have added the code you used above and have made corrections. Im using arcpy.CalculateFieldmanagement for this since there already is a selection. Please specify the spatial reference system for the last parameter. 1) How to switch the data frames coordinate system and calculate based on it. arcpy.AddXY_management(r"path/to/your/dataset")ĬonvertCoordinateNotation_management (r"path/to/dataset", "name_of_new_dataset", x_field, y_field, "UTM", "DMS", "OBJECTID", ) Calcluate X & Y Values Of Network Begin/End Points arcpy. I do not know why I keep getting this error. It provides functions which use geometric types as input and output as well as functions for easily converting geometries between different representations. For the X coordinate of the point itself you calculate the X of the point's Centroid. It is to calculate the geometry of line features - the line begin and end point XY coordinates. The arcgis.geometry module defines useful geometry types for working with geographic information and GIS functionality. There is no extent for a point, only for a buffer polygon around a point. Then, you can use the Convert Coordinate Notation tool which will give you the coordinates into a DMS format. 1 Solution by RichardFairhurst 09-13-2013 12:04 PM Thanks, But I bet your fc is a line feature class. We use this when pushing out data to AGOL to add X and Y attributes to be consumed by other applications such as Collector or Survey123 that need lat/long in WGS 1984 decimal degrees for example. To use this in a script, you must first calculate the XY in metres Here, you can use Calulate Field, or the Add XY Coordinates tool. You are correct AddXY uses or will add the PointX and PointY attributes to your feature when run. Please see the following link for more information. The output point feature class also contains point coordinate fields in a coordinate notation of your choosing. Not sure I understand what you mean with 'The parameters don't include field names', field name should be 1st part of 2nd parameter. The input table's coordinate fields can be in a variety of notations, such as GARS, UTM, and MGRS. by kradijaf 04-30-2022 10:53 PM 'featureclass', 'featurelayer' are not variables, 'featureclass' exists in. Therefore you must use the Convert Coordinate Notation tool which can convert formats of coordinates.Ĭonverts a table containing point coordinate fields to a point feature class. Sys.The reason why it wont calculate the coordinates into DD is because you are using a PCS, which will only give you the XY in metres. Our data is branch versioned and hosted on an enterprise portal. Sys.exit('12 - could not find exploded blobs') 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. Short segment The geometrys short segment will be deleted. To keep records with null geometry, uncheck the Delete Features with Null Geometry parameter. ".format(blobs_exp), 'AREA_GEODESIC', '', 'ACRES') Below is the list of geometry problems and the corresponding repair that will be performed by the tool: Null geometry The record will be deleted from the feature class. Try using the full path to the dataset for that method: rf'x:\.\.\.\ Video 130In this video, you will see how to extract geometry properties from your features and store them in your layer.Using 'Calculate Geometry' in the At. OSError: "WY_testing.gdb\blobs_exp" does not existįailed to execute (AddGeometryAttributes). Self._gp.Describe(*gp_fixargs(args, True))) I'll post the error below, but if you'd like to see my code please use the link above since trying to paste the code neatly here is a nightmare.ġ2 error - Traceback (most recent call last):įile "c:\program files\arcgis\pro\Resources\ArcToolbox\scripts\AddGeometryAttributes.py", line 396, in ĪddGeomAtts = AddGeometryAttributes(fc, geomProperties, lUnit, aUnit, cs)įile "c:\program files\arcgis\pro\Resources\ArcToolbox\scripts\AddGeometryAttributes.py", line 30, in _init_įile "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\_init_.py", line 1287, in Describeįile "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 384, in describe Not sure what's going on and could use some help troubleshooting. Python 3 - ArcPy AddGeometryAttributes and CalculateGeometryAttributes return Traceback OSError: "da.Įssentially I'm having a problem as in the title here. Not sure if it's against rules to post a link to that post, but I'm gonna do it anyway. So I've posted this in gis stackexchange because I had an easier time with their code editor.
0 Comments
|
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |