I'd like to create new points or move existing points at specific individual distances (according to a field in the attribute table), perpendicular to a line. The points are evenly spaced out at 100 m.
-
1Welcome to GIS SE! Thank you for having taken the Tour to learn about our focussed Q&A format. At the moment your pictures contain some text explanation that is not also available within the text of your question body, which makes it unavailable for searching. By addressing this I think it will be more likely that your question can attract potential answerers.– PolyGeo ♦Commented Apr 18, 2018 at 21:31
-
I don't have access to arcpy at the moment (which you will almost certainly need for this), so I won't write this up as a full answer, but I believe you should convert your coastline to a polyline, then use a combination of pointAlongLine (every 100m) and pointFromAngleAndDistance (perpendicular angle and distance from table) to make your new points. The tricky part is figuring out the current angle on the coastline, but it can be done.– phloemCommented Apr 18, 2018 at 21:58
-
Little modification of gis.stackexchange.com/questions/201867/… will solve it– FelixIPCommented Apr 19, 2018 at 0:17
-
My python skills are very limited... Can you suggest a way to understand how to modify the code to suit my situation? Thank you– Irene S.Commented Apr 19, 2018 at 0:29
-
Simply replace [leftP, rightP] with [leftP, ptX] at the end of expression and fixed number in call by field name where you store required distance. This will create perpendicular s. You can convert them to vertices. If points on a wrong side flip original line.– FelixIPCommented Apr 19, 2018 at 20:14
Add a comment
|
1 Answer
I applied workflow referenced in my comment with slightly modified field calculator expression:
def RotateExtend(plyP,sLength):
l=plyP.length
ptX=plyP.positionAlongLine (l/2).firstPoint
ptX0=plyP.firstPoint
ptX1=plyP.lastPoint
dX=float(ptX1.X)-float(ptX0.X)
dY=float(ptX1.Y)-float(ptX0.Y)
lenV=math.sqrt(dX*dX+dY*dY)
sX=-dY*sLength/lenV;sY=dX*sLength/lenV
leftP=arcpy.Point(ptX.X+sX,ptX.Y+sY)
rightP=arcpy.Point(ptX.X-sX, ptX.Y-sY)
array = arcpy.Array([leftP,ptX])
section=arcpy.Polyline(array)
return section
#-----------------
RotateExtend( !Shape!, ! !SHIFT!)
to go from that:
to that:
You can use feature vertices to point tool (Start) on "directions" to derive shifted points of interest.
If you'll find that points are on the wrong side of the line, the simplest solution for you due to lack of Python knowledge is flipping original line(s).