Find polylines with true curves

2527
7
02-08-2022 11:29 AM
Bud
by
Notable Contributor

In ArcMap 10.7.1 (Oracle 18c SDE.ST_GEOMETRY):

Using a geoprocessing tool, is there a way to identify polylines that have true curves?

I know there is a hasCurves Geometry property in ArcPy for ArcGIS Pro. But I don't have access to Pro yet. And regardless, I'd rather use a GP tool for this, than ask my users to use a custom script.

Thanks.

0 Kudos
7 Replies
DanPatterson
MVP Esteemed Contributor

sadly, not, except for converting to a shapefile and compare the geometry lengths

If they differ, then the curve was densified and converted to segments which would have a slightly different length

Geoprocessing considerations for shapefile output—ArcMap | Documentation (arcgis.com)


... sort of retired...
DanPatterson
MVP Esteemed Contributor

demonstrating with polygons... The differences for small shapes may not differ much, but they do differ

point counts go up to.

densification.png


... sort of retired...
Bud
by
Notable Contributor

Here's one way of doing it — similar to what Dan showed above.
(it does involve Python, not strictly GP tools)

1. Create a copy of the polyline FC in a FGDB.

2. Optional: Delete unneeded fields using the Delete Field GP tool.

3. Add new fields: Points_Before, Points_After, and Has_Curve.

4. Use Python in the field calculator to populate Points_Before. The Python is: !shape!.pointcount. Source: How To: Count the vertices for line or polygon features in ArcMap

5. Convert the curves to straight segments via using the Densify GP tool. I used the Angle option: 10 degrees.

6. Use Python in the field calculator to populate Points_After. 

7. Use Select by Attributes to select lines where Points_Before <> Points_After

8. Use the field calculator to populate the selected records in the Has_Curve field. That field is now a static flag that indicates if a line has a curve or not.


In hindsight, using straight python might have been easier:

Use Python in the Field Calculator on a custom Has_Curves field:

def has_curves(geom):
    geom_orig = geom
    geom_densified = geom.densify("ANGLE", 10000, 0.174533)
    if geom_orig.pointCount != geom_densified.pointCount:
        return "Y"
    else:
        return None

has_curves( !SHAPE! )
 

Bud_1-1644983122597.png

Bud_0-1644983861256.png

 

Nellzor
New Contributor

This worked PERFECTLY. Thank you! 

Bud
by
Notable Contributor

Out of curiosity, what technique did you use? The first option I mentioned, or the second "in hindsight" option?

0 Kudos
Nellzor
New Contributor

The field calculate using Python in ArcGIS Pro 2.9.5. We were going in circles trying to figure out/select which segments were arcs. 

Thanks again! Worked as expected. 

JamiePetersen
Occasional Contributor II

First run the Split Line At Vertices.  Then add a field to the result called curveCount.  Then Calculate Geometry to it using the Number of Curves option. The result will be 1 for curve or 0 for not curve.

0 Kudos