I want a tool in ArcGIS Desktop to create points at the alternate sides of a given line. The distance between two alternating side points (zig zag) should be 250m and the distance from any point to line should be 50m (this can be variable and to be given as input by the user).

The output should be this.

closed as off-topic by Vince, Jochen Schwarze, whyzar, xunilk, user2856 Oct 2 '18 at 1:02

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "When seeking help to debug/write/improve code always provide the desired behavior, a specific problem/error and the shortest code (as formatted text, not pictures) needed to reproduce it in the question body. Providing a clear problem statement and a code attempt helps others to help you." – Vince, Jochen Schwarze, whyzar, xunilk, user2856
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Welcome to GIS SE! We're a little different from other sites; this isn't a discussion forum but a Q&A site. As much as possible try to describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. To do this in ArcGIS Desktop I think you'll need to use ArcPy but perhaps look into linear referencing too. – PolyGeo Sep 30 '18 at 6:57
  • I used create points along line but that only gives points along a line. What I want is to create points alternately at each side of the line at a specific distance from the given line. Thats where I'm facing challenge. – Compyetu Sep 30 '18 at 10:37
  • 1
    Copy parallel the line (positive distance one side, negative distance the other side), create points along that copy of the line and then delete the unneeded line. If you want a tool to do this as one step then you will have to nominate your programming/scripting language and have a go at working it out yourself then when you get stuck you can post your code along with any error messages you get for more specific help. – Michael Stimson Sep 30 '18 at 10:43

Convert the lines to be linear referenced Routes using the Create Route tool where the measures are in meters starting at 0 and ending with a measure equal to the length of the line. Then create a table in Excel with 3 fields, Route_ID, Measure and Offset_Distance. For a given Route_ID enter as many rows as it takes to start at 0 and add approximately 229.12878 to the measure in each succeeding row. This value is derived by assuming you want a hypotenuse of 250 meters connecting each point with one side of the right angle triangle being 100 meters (50 meters on each side) using the formula side b = square root((250*250)-(100*100)). For the Measure column I used a formula of =B2+229.12878 copied downward and then converted the formula to values. Alternate the offset with values of each row with the values 50 and -50. Use the Excel to Table tool to import the table into ArcMap.

Event Table

Make sure the Routes are in your map and right click the Table created by the Excel to Table tool and choose the Make Route Event Layer option. Configure the Route event tool using the following settings (change the route feature class name and table name to match the names you assigned):

Make Route Event Layer configuration

This will create a point event layer offset on each side with 250 meter spacing between points as long as the route is a straight line. Curved lines or lines with sharp angles would make it very difficult to determine the exact measure spacing that would be required to maintain exactly 250 meters as the distance connecting the points alternating on each side of the line, but the distance of the offsets and the distance traveled along the line of each adjacent pair of points can easily be kept consistent with this method. So if you instead wanted alternating points offset from the line by 50 meters and wanted the distance traveled along the line to always be 250 meter between the nearest positions on the line that are at right angles to the offset points, that problem is easily solved using this method regardless of the line shape.

Writing a tool that could populate an event table like this would not be that hard if the points produced by this approach would basically solve the problem you want solved. The tool could easily convert the result to a true point feature class in just one additional step using a variety of options (copy features, feature class to feature class, etc.).

Sample Line with Points

  • thanks a lot for this one. I think this will help a lot. Though I need to do this into python script, as I am new to python and not a programmer, I will try to figure it out. – Compyetu Oct 2 '18 at 4:45
  • I was trying to code the above solution. I figured a few steps. I am not a programmer and have tried python for the first time. This code is not giving the output for certain reasons. can anybody give any suggestion? – Compyetu Oct 2 '18 at 17:02
  • It would be good for you to post your code, since it would give me a clue about the kind of inputs you want to get from your users. Also, the process of converting your lines to routes should occur first outside of the tool and those routes should be assumed to exist by the tool and not be created by the tool. Updates to the routes could be scripted for regular updates, but those updates should happen no more than once per day and probably only once per week. Also you need to post code to reactivate this post. – Richard Fairhurst Oct 2 '18 at 17:28

If you're just needing to display point symbols along the lines (something akin to a fancy line symbol), and don't need full blown point features (or event rows), you could use arcobjects to write a class that implements ILayerExtensionDraw to dynamically draw points along the lines.

Implement AfterLayerDraw so that it creates a recycling cursor for the polyline layer with a queryfilter having just the oid field in it and a geometry from the current mapextent. Use Pythagorean theorem to determine step size, then step along each polyline calling IPolyline.QueryNormal as you go, and draw a point at the To end of the returned ILine.

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