0

I have three linestrings and one multilinestring that intersect that I want to create a polygon within the boundaries of the four lines. Here's what the geometry looks like:

enter image description here

Two of the lines are just the northern and southern boundaries (green and pink colors in the image) so they are simple straight lines. The other two are meandering/ugly (they are following ocean isobaths so are seaward and shoreward lines).

enter image description here

I've tried using st_polygonize, but got the error:

Error in plot_sf(x, ...) : NA value(s) in bounding box. Trying to plot empty geometries?

I'm not sure if the issue is the fact that the upper and lower boundary lines are too long, because really I just want a polygon that fills in the space between the shoreward (blue) and seaward (orange) linestrings. Or, the issue could be that at some points the shoreward and seaward lines touch. Any suggestions?

E Norton
  • 83
  • 4
  • Hard to tell without some sample data, but if you just want a polygon(s) between seaward & shoreward `st_union` the seaward & shoreward linestrings & then try `st_polygonize` on the result. `st_make_valid` might come in handy too. – mrhellmann Oct 28 '22 at 20:12
  • You're likely going to want to develop a list of intersects of seaward/shoreward lines, and then I guess I'm repeating @mrhellmann. But list gets you there, even with `st_make_valid`. – Chris Oct 29 '22 at 02:32

0 Answers0