Puedes hacerlo con un poco de arcpy.
1) Hay que hacer el Spatial Join entre los puntos y las líneas para transferir el valor ID de cada línea a cada punto.
2) Averiguar el vértice más cercano de la recta y el punto de entrada.
3) Calcula la dirección de este segmento.
4) Actualizar el campo de rotación de los puntos (con el ID de la línea unida).
import arcpy
import math
def GetAzimuthPolyline(firstPoint,lastPoint):
radian = math.atan((lastPoint.X - firstPoint.X)/(lastPoint.Y - firstPoint.Y))
degrees = radian * 180 / math.pi
return degrees
spatial_reference=arcpy.SpatialReference(3857)
lines_fc = r"C:\GIS\Temp\ArcGISHomeFolder\Default.gdb\_lines"
pnts_fc = r"C:\GIS\Temp\ArcGISHomeFolder\Default.gdb\_points_SpatialJoin2"
lines = [f for f in arcpy.da.SearchCursor(lines_fc,["ID","SHAPE@"],None,spatial_reference)]
pnts = [p for p in arcpy.da.SearchCursor(pnts_fc,["ID","SHAPE@"],None,spatial_reference)]
line_vertices_dict = {line[0]:line[1].getPart(0) for line in lines}
#finding out which vertex of the line is the closest to each of the
#points - to calculate direction later
nearest_vertex = dict.fromkeys([pnt[0] for pnt in pnts])
for pnt in pnts:
vertex_tuple = line_vertices_dict[pnt[0]]
vertex_id = 0
for vertex in vertex_tuple:
distance = round(pnt[1].distanceTo(vertex),2)
if not nearest_vertex[pnt[0]]:
nearest_vertex[pnt[0]] = ({vertex_id:distance})
if vertex_id == 0:
if distance < nearest_vertex[pnt[0]][vertex_id]:
nearest_vertex[pnt[0]] = ({vertex_id:distance})
else:
if distance < nearest_vertex[pnt[0]].values()[0]:
nearest_vertex[pnt[0]] = ({vertex_id:distance})
vertex_id += 1
print nearest_vertex
#{u'A1': {0: 157.06},
#u'C3': {3: 553.08},
#u'D4': {0: 244.37},
#u'E5': {1: 271.14},
#u'B2': {1: 779.33}}
#creating a dictionary of line directions - to be used for point symbols rotation
angles_dict = {pnt[0]:
GetAzimuthPolyline(pnt[1].firstPoint,line_vertices_dict[pnt[0]]
[nearest_vertex[pnt[0]].keys()[0]]) for pnt in pnts}
#calculating the direction of the segment connecting the symbol point and the nearest vertex
with arcpy.da.UpdateCursor(pnts_fc,["ID","RotatField"]) as upd_cur:
for row in upd_cur:
row[1] = angles_dict[row[0]]
upd_cur.updateRow(row)
Así es como podría verse: