Enhancing OSM Coastline Data: Improving Estuary and River Polygon Handling

I’ve been working on enhancing OpenStreetMap’s coastline data to better represent estuaries and other water bodies connected to the sea. In my project (fbriol/uwp), I’ve developed a small program that supplements the existing coastline data by enhancing the water polygons used to compute a high-resolution land-sea mask in real time.

While the overall approach works well, there are a few limiting cases:

  • The program currently selects only the first polygon in contact with the coastline.
  • When a river is represented by a single polygon, the process ends up including the entire river.
  • If an estuary is split into multiple polygons, only the section corresponding to the first polygon touching the coastline is included.

I would be grateful for any thoughts, suggestions, or contributions to help refine this process.