<SPAN class="comment token"># --- for posterity, c0 is a polygon circle with a piece cut off</SPAN> <SPAN class="comment token">#</SPAN> <SPAN class="keyword token">import</SPAN> json c0 <SPAN class="operator token"><</SPAN>Polygon object at <SPAN class="number token">0x15b885eb860</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">0x15b87f800a8</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="operator token">></SPAN> j <SPAN class="operator token">=</SPAN> json<SPAN class="punctuation token">.</SPAN>loads<SPAN class="punctuation token">(</SPAN>c0<SPAN class="punctuation token">.</SPAN>JSON<SPAN class="punctuation token">)</SPAN> has_curves <SPAN class="operator token">=</SPAN> np<SPAN class="punctuation token">.</SPAN>any<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="string token">'curve'</SPAN> <SPAN class="keyword token">in</SPAN> i <SPAN class="keyword token">for</SPAN> i <SPAN class="keyword token">in</SPAN> list<SPAN class="punctuation token">(</SPAN>j<SPAN class="punctuation token">.</SPAN>keys<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> has_curves <SPAN class="token boolean">True</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
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 !!!
Thank you for sharing your idea for a feature that could identify curves in polylines and polygons with the Describe function. I understand that you have several applications where curves (Bezier curves) need to be densified for the tools (widgets) in the applications to work correctly, and it would be useful to be able to log all the features that needed to be densified because they had Bezier curves.
I wanted to let you know that there is already a <arcpy.geometry>.hasCurves property in arcpy that returns True if the geometry object has curves. This property can be used to check if a feature class has curves or not.
I wanted to know if this satisfies your needs in place of a Describe function?
We are closing this idea, as there is already an <arcpy.geometry>.hasCurves property in arcpy that returns True if the geometry object has curves. If you have any concerns about this decision, please feel free to let us know by responding below. Thank you for you understanding.
Meld je aan om te posten, content te volgen en meer. Nieuw hier? Registreer gratis.