-
Notifications
You must be signed in to change notification settings - Fork 5
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
Cannot plot model with edge geometries longer than a single line segment #1218
Labels
python
Relates to one of the Ribasim python packages
Comments
In this case, we require https://shapely.readthedocs.io/en/stable/reference/shapely.get_coordinates.html Then some indexing trickery to setup a matplotlib LineCollection. |
Huite
added a commit
that referenced
this issue
Mar 8, 2024
visr
pushed a commit
that referenced
this issue
Mar 8, 2024
Fixes #1218 test_edge_plot: ![image](https://github.com/Deltares/Ribasim/assets/13662783/a6d270c5-407e-4234-9e27-001499273500) And one of the testmodels I edited in QGIS to add additional vertices: ![image](https://github.com/Deltares/Ribasim/assets/13662783/58ff9234-6aa9-46b1-b9d6-b1c9b058ef77) I also took the opportunity to use `.pop()` on the kwargs dicts. The marker colors also had to be adjusted since there's no longer a 1:1 marked:edge_geometry relationship. I'm using a numpy array instead of generating the list, since the arrays support indexing. Using boolean indexing for setting the colors doesn't work very well because the lengths of the color names might differ, and need to be supplied as the dtype. `np.where` is clever enough to take care of it, generating the right dtype on the fly.
Hofer-Julian
pushed a commit
that referenced
this issue
Mar 11, 2024
Fixes #1218 test_edge_plot: ![image](https://github.com/Deltares/Ribasim/assets/13662783/a6d270c5-407e-4234-9e27-001499273500) And one of the testmodels I edited in QGIS to add additional vertices: ![image](https://github.com/Deltares/Ribasim/assets/13662783/58ff9234-6aa9-46b1-b9d6-b1c9b058ef77) I also took the opportunity to use `.pop()` on the kwargs dicts. The marker colors also had to be adjusted since there's no longer a 1:1 marked:edge_geometry relationship. I'm using a numpy array instead of generating the list, since the arrays support indexing. Using boolean indexing for setting the colors doesn't work very well because the lengths of the color names might differ, and need to be supplied as the dtype. `np.where` is clever enough to take care of it, generating the right dtype on the fly.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We support LineString and MultiLineString geometries for edges. But cannot plot model with edge geometries longer than a single line segment in Ribasim Python.
There are some similar limitations regarding edge geometries described in #352.
The text was updated successfully, but these errors were encountered: