I have a points layer (Electrical Transmission structures) and a Transmission line layer. The points layer sits on top of the line layer and because the line layer changes direction all the time it is hard to label the points layer sometimes. What I would like to do is label the points layer perpendicular to the line layer.
Does anyone have an answer for me?
Solved! Go to Solution.
Hi @GIS_Rookie ,
I suppose you can do something like this at the end of the script:
# start insert cursor
flds_out = (fld_label, fld_angle)
with arcpy.da.UpdateCursor(fc, flds_out) as curs:
for row in curs:
lbl = row[0]
if lbl in dct_res:
angle = dct_res[lbl]
if angle < 0:
angle += 360
else:
pass
# angle = 400
curs.updateRow((lbl, angle, ))
Thanks @XanderBakker ! This worked for me 🙂
Just curious about why those numbers are heading to north and south, not in one direction? And some of numbers lost their directions. Maybe there is some kind of explanation? Tried to build 1 script from 2 but without success.
P.S. Saw your other posts (Translating the lowest overhead power lines into a continuous surface). They are also interesting!
Hi @GIS_Rookie ,
So, ArcGIS has its labeling engine Maplex that has a lot of settings you can play with to get the result you want. I understand that it would be better to have them all point in a certain direction in this case. However, if you have a line that describes a circular movement, it would be best that in a certain location the text switches its orientation in order to be closer to horizontal and enable readability for the end-user.
I also had some issues with the texts near the start or end of the line, not sure what is going on there.
Hi @XanderBakker !
I am trying to run your script and I have some questions.
Thank you and would greatly appreciate any help!
Hi @MarcoConopio1 ,
The error is pointing to the use of a field that does not exist in the featureclass. Can you check that the fields with names assigned to the variables "fld_orden" and "fld_label" exist in your featureclass?
Hi, @XanderBakker . Thanks a lot for your script, it’s very useful.
I am having an issue with angles as when my ‘ANGLE2’ field gets populated the only value I get is: -116.907208734888 (for every row).
I am basically trying to draw a short line that will mark 1 km along the road. I have created points along the road, and now trying to label them with ‘___’.
I want this labels to be perpendicular to the road.
I have added two fields to my points shapefile (‘Pole’ with values as ‘___’ (data type: text), and “ANGLE2” with empty values (data type: double)).
Please take a look at the attached file for a visual explanation.
I will appreciate any advise, thanks!