5

I have thousands of straight line segments (all separate features). I need to convert each straight line segment into two arcs, with the arcs opposite of each other. For example, I used the XY to Line tool and selected Great Circle line type to create the arcs. That gives me one arc, but I need an arc opposite of that (like a reverse great circle arc). It does not necessarily have to be a great circle arc, just an arc of some sort. I have also tried to use the table to ellipse tool and it does not work as I anticipated.

The picture below explains what I am trying to do. The red line is the straight line which I already have. The blue lines are what I am needing. I can get the top blue line by selecting Great Circle in the XY to Line tool, but I somehow need to create another arc in the opposite direction, which is what the bottom line represents.

I am using ArcGIS for Desktop 10.2.2 Advanced and have full access to any tools/features.

Arc

  • Please edit your Question and include your ArcGIS Desktop version, and a picture of what it is you're trying to achieve. – Midavalo Apr 21 '16 at 19:21
  • ArcMap has a "Mirror Features" tool. This will create a mirror image copy of a feature, across a line. It is available in the Customize menu. – klewis Apr 21 '16 at 20:02
  • I tried using that tool. That works when doing it manually, but I have thousands of lines to create arcs from. I need an automated way of using that tool. – GISGUY52738 Apr 21 '16 at 20:08
1

In your table of content put empty polyline feature class on the very top. Place your layer with curves underneath and run script.

Original:

enter image description here

Mirror:

enter image description here

Script:

import arcpy, traceback, os, sys, time

mxd = arcpy.mapping.MapDocument("CURRENT")
mirror=arcpy.mapping.ListLayers(mxd)[0]
original=arcpy.mapping.ListLayers(mxd)[1]

try:
    def showPyMessage():
        arcpy.AddMessage(str(time.ctime()) + " - " + message)

    curT=arcpy.da.InsertCursor(mirror,"Shape@")
    g=arcpy.Geometry()
    geomList=arcpy.CopyFeatures_management(original, g)
    n=len(geomList)
    for shp in geomList:
        part=[p for p in shp.getPart(0)]
        straight=arcpy.Polyline(arcpy.Array([part[0],part[-1]]))
        mirList=arcpy.Array()
        for p in part:
            dL=straight.measureOnLine(p)
            theP=straight.positionAlongLine(dL).firstPoint
            pM=arcpy.Point(2*theP.X-p.X,2*theP.Y-p.Y)
            mirList.add(pM)
        mirLine=arcpy.Polyline(mirList)
        curT.insertRow((mirLine,))
    del mxd
except:
    message = "\n*** PYTHON ERRORS *** "; showPyMessage()
    message = "Python Traceback Info: " + traceback.format_tb(sys.exc_info()[2])[0]; showPyMessage()
    message = "Python Error Info: " +  str(sys.exc_type)+ ": " + str(sys.exc_value) + "\n"; showPyMessage()
  • Thank you for the script. I tried using it, and for some reason it creates straight lines connecting the endpoints of the curves, not the mirror of the original curve. I will try to manipulate your script and see if I can get it to mirror the curves. In case this makes a difference, every curve is an individual curve, not curves that are connected to each other. – GISGUY52738 Apr 22 '16 at 13:26
  • I tested it on projected feature class, shapefile – FelixIP Apr 22 '16 at 19:25
  • It won't work on true curves – FelixIP Apr 22 '16 at 19:47
  • It's possible it did not work because my data was not projected. Regardless, I tried it again on a projected shapefile and it works. Thank you. – GISGUY52738 Apr 22 '16 at 19:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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