Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to keep track of centerline indices when cutting them and measuring lengths #14

Open
erikmannerfelt opened this issue Jun 12, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@erikmannerfelt
Copy link
Owner

To measure length differences, the mean length of one year can be subtracted to another. When measuring the spread, however, it is better to do an element-wise subtraction (each element being a buffered centerline's length) and deriving the spread of that. This requires some way of keeping track of the index of each centerline. As far as I'm aware, the order of LineStrings in the MultiLineString from buffer_centerlines() is kept when cutting, but this is not a guarantee unless there's a check for it, and #12 would mess with the order.

One potential solution would be to allow a dictionary as the centerlines in cut_centerlines(). For example:

>>> centerlines = {0: LineString(...), 1: LineString(...)}
>>> glacier_lengths.cut_centerlines(centerlines, cut_geometry)
{1: LineString(...)}

Here, I assume that #12 is implemented, and that centerline "0" was deemed invalid in some way, such as that it didn't intersect the cut-geometry.

@erikmannerfelt erikmannerfelt added the enhancement New feature or request label Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant