ArcMap 10.7.1 — Oracle 18c SDE.ST_GEOMETRY
I have a polyline FC that has true curves.
And I have an ArcPy script that updates the M-values of the vertices in the lines:
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:
Question:
With ArcPy, is there a way to edit vertices without removing true curves from the SHAPE?
For example, is there way to do something like this?
UpdateVertex (shape, partNum, vertexNum, [x, y, z, m])
Related:
arcpy.Geometry
constructors should always be provided with aSpatialReference
parameter. Failure to do so means the default resolution will be applied at construction, then the actual SpatialReference silently applied on insert, resulting in truncation of coordinate values to 3 or 4 decimal places and possible geometry corruption (depending on magnitude). TheGeometry
itself has ahasCurves
property which will let you know if you are about to corrupt the shape, but only ArcObjects can capture and re-apply the CAD (maybe).hasCurves
property: it looks like that property isn't available in ArcGIS Desktop 10.7.1. desktop.arcgis.com/en/arcmap/10.7/analyze/arcpy-classes/…with
obviates need for thedel
lines, and string math is inefficient/clumsy compared to usingos.path.join()
.