Skip to main content

I’ve got an interesting problem with a land (polygon) and matching coastline (polyline) data. For cartographic styling reasons (using offsets), it’s important that the coastline is always traversing with the land on a consistent side (say, on the right). Where it’s not, I’d like to reverse the polyline coordinates. Fortunately, the polylines are simple with only one segment, i.e. not multipolyline.

 

Logically, I could buffer each section of coastline on one side (or offset the polyline) and detect a material overlap with the land. If no overlap, reverse the polyline.

 

Has anyone done anything like this before or have any suggestions on the best way to implement it in Form? Many thanks.

 

/Warren

I''ve used the direction between the first and last point of the line as a broad indication of direction, but with curved coastlines (which, depending on your geography, they may very well do) that's not really very precise.

 

What if you ditch the coastlines alltogether and recreate them from the land polygons (Intersector)?


Another idea: buffer the land polygon(s) slightly inward, use a LeftRightSpatialCalculator to determine the orientation, and an Orientor to flip the coast lines that have the wrong orientation.Flip


Many thanks for the suggestions.

 

@Hans van der Maarel​ My coastlines have attributes that I need to preserve so your suggestions comes with complications. I would also need to avoid making new coastlines where two land masses meet, so it would swap one topological analysis for another!

 

@geomancer​ I will give this method a try. I'll have to make sure that the candidate land polygons are only the ones which actually intersect the coastal polylines.


Reply