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).
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
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.
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):
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.).
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.
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