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

chore: added logic to deal with MultiPolygon geometries #94

Conversation

Carsopre
Copy link
Collaborator

No description provided.

@Carsopre Carsopre linked an issue Oct 19, 2023 that may be closed by this pull request
Copy link
Contributor

@ArdtK ArdtK left a comment

Choose a reason for hiding this comment

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

A few suggestions/questions

koswat/core/geometries/calc_library.py Outdated Show resolved Hide resolved
koswat/core/geometries/calc_library.py Outdated Show resolved Hide resolved
)
if isinstance(self.koswat_object.new_layer_surface, geometry.MultiPolygon):
_combined_xy = list(
map(
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand how map() is used here. What is the iterable?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good o ne, I need to revise this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This should indeed be list(map(concatenate, zip(...))) however, I do not seem to find the failing test for which this piece of the code was required.

zorder=1,
linestyle="solid",
)
if isinstance(self.koswat_object.new_layer_surface, geometry.Polygon):
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't you test on the instance type of new_layer_geometry as new_layer_surface is (should be) a LineString?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

as far as I recall we store new_layer_geometry as a Polygon, not a LineString. I will have to check this again.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, this is a LineString, I think I had a failing test but I do not manage to find it, so I reverted all the added code here.

koswat/plots/dike/koswat_layer_plot.py Outdated Show resolved Hide resolved
Copy link
Contributor

@ArdtK ArdtK left a comment

Choose a reason for hiding this comment

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

Code looks fine

@Carsopre Carsopre merged commit c8b0683 into master Oct 23, 2023
@Carsopre Carsopre deleted the fix/84-measures-not-calculated-when-there-is-a-multi-polygon-in-layers branch October 23, 2023 11:01
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.

Measures not calculated when there is a multi-polygon in layers
2 participants