I have a river network (Line with arrow as shown in image below) and I need to create perpendicular lines to the river at every 15 meters as you walk along it (see image below). Is there a function in PostGIS capable of doing this?
No clear existing function to do this, but working back from the great suggestions on this post: Making perpendicular lines through each polygon edge using PostGIS?
Assuming you are good with PostGIS syntax, this might help you:
- Split the line into 15m segments, like this: https://www.northrivergeographic.com/qgis-split-a-line-at-an-interval
- Loop every segment in the newly segmented line and for each segment:
- Create parallel lines with ST_OffsetCurve with a desired distance D (can be as longer than the lake/sea as shown above, we will clip them later), on both sides of the line
- For every 15m segment, make a new line from the centroid of that segment to the centroid of the corresponding parallel lines with ST_MakeLine
- You should have perpendicular lines, spaced 15m extending beyond the river basin/lake
- Clip the lines with the sea region