Select to view content in your preferred language

How do I create a square of a defined area around my points?

1957
13
01-12-2018 01:56 AM
David-PaulKlein
Emerging Contributor

How do I create a square of a defined area around my points when each point has a different size (see attached file)? My aim is to show the plot size on a map and colour it to show differences in the amount of carbon stored... 

Thanks a lot for your help!

0 Kudos
13 Replies
David-PaulKlein
Emerging Contributor

Wow, thank you so much for your efforts! I will try it out the next days

delongtime
Occasional Contributor

Thanks for this tool! Exactly what I need. Only, I'm having the following trouble. Can you troubleshoot your code for me? I'm using ArcGIS version 10.6. The error message I receive is as follows ... many thanks in advance:

Running script Point2Rectangle...
Failed script Point2Rectangle...

Traceback (most recent call last):
 File "C:\Users\username\AppData\Roaming\ESRI\Desktop10.6\ArcToolbox\My Toolboxes\point2rectangleID.py", line 62, in <module>
 main()
 File "C:\Users\username\AppData\Roaming\ESRI\Desktop10.6\ArcToolbox\My Toolboxes\point2rectangleID.py", line 18, in main
 AddIDField(fc_out, fc_in, fld_id)
 File "C:\Users\username\AppData\Roaming\ESRI\Desktop10.6\ArcToolbox\My Toolboxes\point2rectangleID.py", line 58, in AddIDField
 arcpy.AddField_management(fc_out, fld_id, fld_in.type, fld_in.precision, fld_in.scale, fld_in.length)
 File "c:\program files (x86)\arcgis\desktop10.6\arcpy\arcpy\management.py", line 3424, in AddField
 raise e
ExecuteError: Failed to execute. Parameters are not valid.
WARNING 000012: OBJECTID already exists
ERROR 000800: The value is not a member of TEXT | FLOAT | DOUBLE | SHORT | LONG | DATE | BLOB | RASTER | GUID.
Failed to execute (AddField).


Failed to execute (Point2Rectangle).
0 Kudos
XanderBakker
Esri Esteemed Contributor

Can you share the data that you are using? I probably know what is going wrong, but would like to validate some things.

0 Kudos
delongtime
Occasional Contributor

Thank you for such a quick reply. I actually resolved it myself ... I was premature with my question, and was actively editing my post when you replied. The problem lies with using the feature class' FID or OBJECTID as the unique identifier for "ID field". I created a new column and copied the FID over, and the tool worked properly when I directed it to use that column as the "ID field". However, I suppose you could edit your code to account for a user using the FID/OBJECTID as the "ID field" since it is listed as a valid field in the drop down menu.