13

The only good way of creating circles in ArcMap is using true arc, (compound curves) but I need to convert those to vertex (densifying) because of a compatibility problem. I need info for geodatabase and SDO_geometry (arcsde)

and yes there is a way. I use:

UPDATE layer1 a SET arctype = 'compound' WHERE has_compound_curves(a.shape) <> 0;

and then using ET Geotools to densify layer by layer.

But there should be easier way of doing this straightforward in Oracle or ArcMap, and I just want to densify the features that have true arc. I don't want any unnecessary vertices on straight lines and so on.

How can I identify true arcs in ArcMap, and how can I densify them as fast and easy as possible?

Same for Oracle SQL.

2
  • Here is a thread from 2006 that uses VBA to find true arcs, but since ArcGIS no longer supports VBA, is there a Python or UI way to do this? Dec 11, 2012 at 23:56
  • I am hoping that this "ArcGIS Idea" does not mean that it is impossible to find true curves in 10.0. Dec 12, 2012 at 0:14

6 Answers 6

9

I was asked this question today ("How do I identify if a featureclass has curves) and was given some arcpy code suggestions. Modify the following code as you see fit (a flag variable instead of a message for example)

geometries = arcpy.CopyFeatures_management("inputFeatures", arcpy.Geometry())
import json
for g in geometries:
    j = json.loads(g.JSON)
    if 'curve' in j: print "You have true curves!"
    else: print "No curves here"

No curves here
No curves here
You have true curves!
You have true curves!
No curves here
You have true curves!
No curves here
No curves here
You have true curves!
You have true curves!
You have true curves!
You have true curves!
You have true curves!
4
+50

By using Densify ,Curve segments are simplified through densification by either the Maximum Deflection Angle, or Maximum Offset Deviation parameter.

So Straight line segments will be kept intact.

4
  • 1
    While this won't help to identify the true curves, I agree that using Densify with the Angle parameter is a fast and effective way to densify them very quickly. Using the Angle parameter will also generally only densify the true curves, whereas the Distance option will densify all boundaries, leading to (at least in my tests, using the default parameters) up to a 10x increase in file size. Dec 14, 2012 at 16:23
  • ok, so there are different solutions, but my problem is that I am not able to use any toolbox on my sde layer, we are locking the layers for checkout/checkin, What I want to do is to run a tool/script that finds these curves and after that Densify, but if it is what you are saying that densify only touch true arcs, I can check out all features, but are there any edit tool that densifies more than ET geotools
    – jonaktiv
    Dec 19, 2012 at 9:21
  • this answer gis.stackexchange.com/a/37082/2969 tries to extract straight lines, but you can extract curves by substracting straight lines from the whole layer, so you can locate curves, without touching the whole data. but i have no idea how ET geotools works.
    – geogeek
    Dec 19, 2012 at 9:39
  • jonaktiv, the Densify tool that @geogeek links to is a core ArcGIS tool available with an ArcEditor or ArcInfo license, not part of ET GeoWizards. Dec 19, 2012 at 15:27
3

Building on @KHibma's answer, the data access cursor has the token SHAPE@JSON which can be used to check for curves without importing the json module.

with arcpy.da.SearchCursor ("InputFeatures", ["OID@", "SHAPE@JSON"]) as curs:
    for oid, json in curs:
        if "curve" in json:
            print "{} is curved".format (oid)
2

I think once you've selected them, you can densify them. The (untested) code below could be adapted to do this. (Assumes Bezier curves qualify as arcs).

public void SelectTrueArcFeatures()
{
    var editor = ArcMap.Application.FindExtensionByName("ESRI Object Editor") as IEditor;
    if (editor.EditState != esriEditState.esriStateEditing)
        throw new Exception("start editing first");
    var fLayer = ((IEditLayers)editor).CurrentLayer;
    if (fLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPoint)
        throw new Exception("current edit layer must have polylines or polygons");

    var fSel = fLayer as IFeatureSelection;
    fSel.Clear();
    var fCur = fLayer.FeatureClass.Search(null,false);
    IFeature feat;
    while ((feat = fCur.NextFeature()) != null)
    {
        if(HasAnArc(feat.Shape))    
            fSel.SelectionSet.Add(feat.OID);
    }
    fSel.SelectionChanged();
    System.Runtime.InteropServices.Marshal.FinalReleaseComObject(fCur);
    ArcMap.Document.ActiveView.Refresh();
}

private bool HasAnArc(IGeometry geom)
{
    var segcoll = geom as ISegmentCollection;
    if (segcoll == null)
        return false;
    for (int i = 0; i < segcoll.SegmentCount; i++)
    {
        if (segcoll.get_Segment(i) is ICircularArc 
          || segcoll.get_Segment(i) is IBezierCurve)
          return true;
    }
    return false;
}
4
  • is this editing script? how will I put this code to arcmap? and how does the code work, does it find beizercurves or only densifies the ones I have found(selected)
    – jonaktiv
    Dec 19, 2012 at 9:25
  • It is c#. If you aren't already familiar with c# (or .net customization) you might ask for someone to write the equivalent with python. To use this code you will need to compile it with Visual Studio. It selects all polylines (or polygons) in the current edit target layer that have any non-linear segments. Dec 19, 2012 at 16:35
  • @jonaktiv If you're using 9.3.1 you could do this with VBA in a calculator script. Calculate a flag attribute, then select features that have the flag. If you're using 8.3 you can actually update geometry using the field calculator directly and would not need a flag attribute. Dec 19, 2012 at 16:39
  • Superb! I am very grateful, I was afraid it wasn't possible
    – jonaktiv
    Dec 20, 2012 at 6:46
2

this Curves And Lines addin lets you select shapes which have curves in them: http://www.arcgis.com/home/item.html?id=b59665cb906a435da3f8c45332d7cfdf

1

I created my own solution for this as well, based upon the suggestion by @geogeek. I created a model that compares the source layers vertexes with a vertexes from a densified (using the ANGLE option) copy of the source layer. The output is a layer of vertexes that "don't match" the source. The final step selects all of the source features that intersect the unmatched points, thereby identifying features that contain true curves.

Because this model does not split features at the start and end points of the arc, the entire feature will be exported. Therefore, if you have a single geometry that is connected as "line-curve-line-curve-reversecurve-line", the whole feature will be output, not just the curve portions. Use the points to determine where the actual curve(s) exist.

You can download the model called "Identify True Curves" from the ArcGIS Resource Center "Analysis" gallery.

1
  • Thank you ALL, this is so great. we have arcgis 9.3.1 but i will test on my private computer EDIT: it is a very good tool, but not fast enough though :/ what I want is to be able in editing environment to find/select features with true arcs and then checkout my features with true arcs and then densify (are there any editing densify tools more than et geotools, why i dont want Et getools is because you have to change target layer, we densify maybe 10 different layers.
    – jonaktiv
    Dec 19, 2012 at 9:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.