in an attempt to qc certain possibilities we wanted to try and create a line feature that has a valid geometry but 0.0 shape length. we actually saw this in real-world data, unfortunately, we no longer have the data set where we saw this, so i was wondering if it is even possible to create such a feature?
conceptually, a 2 point line where the start and end coordinate
pl = arcpy.Polyline(arcpy.Array([arcpy.Point(0.0, 0.0), arcpy.Point(0., 0.)])) pl.length 0.0
my original thought was that the start and end coordinates would have to be the same, but ArcMAP doesnt allow that to be saved. the user is notified that there is invalid geometry and edits cannot be saved.
You can create the feature but not the featureclass... Geometry is validated when you try to create it (eg as a shapefile or a featureclass). You would need to have a file that contains bad geometry to begin with I suppose so that you could use Check Geometry and/or Repair Geometry.
Try creating a 2 point line in ArcMap and/or Pro, then edit the coordinates there to see if it will save. Attempts to use
arcpy.management.CreateFeatureclass and an arcpy.da.InsertCursor and a CopyFeatures just create a null geometry as you can see from the attached shapefile