-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add optional 'Basin / area' spatial table (#1200)
Fixes #960 It looks like this when loaded in QGIS: ![image](https://github.com/Deltares/Ribasim/assets/4471859/d0c4ad97-9a91-483d-9568-2c3dbb8b3d5b) The color is still random as I didn't implement a `renderer` yet, though that can be a follow up. I did have to take special care to make sure these polygons were not plotted on top, hiding the model. MultiPolygons and missing polygons also work.
- Loading branch information
Showing
9 changed files
with
131 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from ribasim.geometry.area import BasinAreaSchema | ||
from ribasim.geometry.edge import Edge | ||
from ribasim.geometry.node import Node | ||
|
||
__all__ = ["Edge", "Node"] | ||
__all__ = ["BasinAreaSchema", "Edge", "Node"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from typing import Any | ||
|
||
import pandera as pa | ||
from pandera.typing import Series | ||
from pandera.typing.geopandas import GeoSeries | ||
|
||
from ribasim.schemas import _BaseSchema | ||
|
||
|
||
class BasinAreaSchema(_BaseSchema): | ||
node_id: Series[int] | ||
geometry: GeoSeries[Any] = pa.Field(default=None, nullable=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters