I have a multipart polyline FC that has true curves (Oracle 18c SDE.ST_GEOMETRY).
I want to update the coordinates of the vertices in the lines via ArcPy — without losing the true curves:
import arcpy connection = "Database Connections\my_conn.sde" feature_class = connection + "\my_owner.my_fc" spatial_reference = arcpy.Describe(feature_class).spatialReference with arcpy.da.Editor(connection) as edit_session: with arcpy.da.UpdateCursor(feature_class, "SHAPE@") as cursor: for row in cursor: geometry = row[0].densify("ANGLE", 10000, 0.174533) parts = arcpy.Array() for part in geometry: points = arcpy.Array() for point in part: point.M = geometry.measureOnLine(point) points.append(point) parts.append(points) row[0] = arcpy.Polyline(parts, spatial_reference) cursor.updateRow(row)
The script reconstructs and replaces the geometry of the lines. So, unfortunately, it removes the true curves from the shapes.
Before running script:
After running script:
Idea:
Could ESRI consider giving us a clean way to edit vertices — without removing the true curves from the SHAPE?
- I don't want to densify the curves into straight segments...I want to keep the true curves.
- It would be ideal if there were a clean way to do this; not a workaround like converting to JSON and parsing out the curve info from the JSON text (would be messy/fragile).
For example, a simple method like this would be helpful:
UpdateVertex (shape, partNum, vertexNum, [z, m])
#It wouldn't replace the shape or replace the vertex. It would *update* a coordinate in the vertex.
#So the true curves would remain intact.
Merged from a separate idea:
Currently, there isn't a way to directly access a polyline's true curve information.
We're aware that it's technically possible to access true curves indirectly via JSON. But that requires parsing the JSON text to grab the true curve info, which is slow and messy.
It would be helpful if we had a cleaner way to access curves.
Thanks.
Thank you for your suggestion regarding a cleaner way to access true curves in a polyline through an ArcPy property. We understand you feel the current method of accessing the information indirectly through JSON can be improved. To better understand your idea, could you please clarify if you are looking for a way to determine whether or not the geometry has curves? If so, this is already offered using the hasCurves property of geometry objects. Or are you looking for a similar property, but for accessing and manipulating the actual curve information rather than just confirming its existence? We appreciate feedback from all users visiting the ideas exchange, as it helps us make informed decisions about future updates, and look forward to hearing from you.
Yes, I think this is right:
Or are you looking for a similar property, but for accessing and manipulating the actual curve information rather than just confirming its existence?
In hindsight, my wording wasn't great.
Thank you for clarifying, while looking into this further I noticed you more recently submitted a similar idea, 1250953. We will merge these ideas together. To help us gauge user interest in this idea, please consider giving it a kudo (The author's kudo is not automatically applied).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.