Tick Marks for Line Using leaflet and PostGres

Skip to first unread message

Gary Whitcher

Apr 11, 2022, 5:50:03 PMApr 11
to Leaflet
Has anyone seen an add-in for Leaflet that puts markers at specific interval points on a line. (Say every 1000 feet) The marker needs to rotate with the line segment. I have the rotated maker, but some of my calculated angles on the segments are not correct and the rotation of the marker is therefore incorrect as well. 

I am using PostGres for the geometry. using the ST_LineInterpolatePoint function in Postgres I locate the point on the line at the intervals.

I then calculate the angle of the segment using the points from the line using the point before the interval distance and the point after the interval distance.

select degrees(st_azimuth(st_makepointx,y(x,y), st_makepoint(x,y))

 Sometimes the angle works sometimes it is way off.

Reply all
Reply to author
0 new messages