Skip to content

Conversation

@krober10nd
Copy link
Collaborator

summary

Adds first-class linestring support to geodata ingestion and plotting, and hardens polygon area computation for NaN-separated rings. This enables downstream breakline generation (more to come in later PRs) and improves correctness for mixed shapefiles without changing default behavior.

changes

geodata
Add linestrings property (default empty) and propagate via ParseShoreline.
Plot supports rendering linestrings and start/end markers.
shapefile reader
Classify closed shapes (within tolerance) as polygons; open shapes as linestrings.
Output includes polygon rings and linestring collections.
polygon area
shoelace updated to handle NaN-separated sub-polygons with per-ring closure and summed area.

motivation

Many shoreline datasets mix polygons and open lines; linestring awareness is required for breakline workflows.
Robust area computation avoids errors for multi-ring polygons and hole structures.

@WPringle
Copy link
Collaborator

WPringle commented Oct 23, 2025

@krober10nd Is there any example you could add to demonstrate the feature(s)?

Copy link
Collaborator

@WPringle WPringle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Standard tests are passing except for TestJBAY.m, where the numbers of vertices was fewer nodes than expected and the area was quite a bit greater than expected. But this may be an improvement due to the way the linestrings are handled? Can check the output and make sure it looks good with the new method, and if so update the test vertex/element/area numbers?
  2. Providing an example or clearer description of use case that highlights what can be done now that couldn't before would help.
  3. As well, update the changelog.

@krober10nd
Copy link
Collaborator Author

krober10nd commented Oct 23, 2025

@krober10nd Is there any example you could add to demonstrate the feature(s)?

This feature is mostly for a future pull request in which there's both rings and linestrings that are passed to geodata and the user wants to constrain both the features in the mesh connectivity.

I'll take a look at TestJBAY.m

@WPringle
Copy link
Collaborator

alright,

@krober10nd Is there any example you could add to demonstrate the feature(s)?

This feature is mostly for a future pull request in which there's both rings and linestrings that are passed to geodata and the user wants to constrain both the features in the mesh connectivity.

I'll take a look at TestJBAY.m

alright, let's just make sure about the test, then can merge this. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants