Identify Curves in Python with Describe

236
1
08-28-2012 12:25 PM
Status: Open
Labels (1)
MichaelVolz
Esteemed Contributor
It would be great if python could identify curves in polylines and polygons with the describe function.  I have several applications where curves (Bezier curves) need to be densified for the tools (widgets) in the applications to work correctly.  When processing this data it would be nice to be able to log all the features that needed to be densified because they had Bezier curves, especially if a feature caused the processing tool to crash so I would be able to focus in quickly on the problematic geometry.

In the forums people have suggested to convert the feature class to a shapefile first and then compare the original feature class to the shapefile to identify the curves, but this is a cumbersome process that seems like it could be simplified if the Bezier curves could just be identified in the original feature class.
1 Comment
DanPatterson_Retired
# --- for posterity, c0 is a polygon circle with a piece cut off
#
import json

c0
<Polygon object at 0x15b885eb860[0x15b87f800a8]>

j = json.loads(c0.JSON)

has_curves = np.any(['curve' in i for i in list(j.keys())])

has_curves
True

Now if you want to count the number of curves, you have to dig into the dictionary a bit more...

Just add this or equivalent to arcpy.da.Describe !!!