geosdhydro
¶
geosdhydro package.
GIS tools for semi-distributed hydrologic modelling
Classes:
-
ShapefileToSwiftConverter
–Converts shapefile data to SWIFT JSON catchment structure.
Functions:
-
get_parser
–Return the CLI argument parser.
-
main
–Run the main program.
ShapefileToSwiftConverter
¶
ShapefileToSwiftConverter(
gdf: GeoDataFrame, include_coordinates: bool = False
)
Converts shapefile data to SWIFT JSON catchment structure.
Parameters:
-
gdf
(GeoDataFrame
) –GeoDataFrame loaded from shapefile containing link data
-
include_coordinates
(bool
, default:False
) –Whether to include lat/lon in node definitions
Methods:
-
convert
–Convert shapefile data to SWIFT JSON format.
-
save_to_file
–Save converted data to JSON file.
Attributes:
-
gdf
(GeoDataFrame
) –The geodataframe from which we build the json file.
-
include_coordinates
(bool
) –Should the Latitude/Longitude coordinates be derived from the geometry and written in the json file.
Source code in src/geosdhydro/_internal/swift.py
12 13 14 15 16 17 18 19 20 21 |
|
include_coordinates
property
writable
¶
include_coordinates: bool
Should the Latitude/Longitude coordinates be derived from the geometry and written in the json file.
convert
¶
Convert shapefile data to SWIFT JSON format.
Returns:
Source code in src/geosdhydro/_internal/swift.py
79 80 81 82 83 84 85 |
|
save_to_file
¶
Save converted data to JSON file.
Parameters:
-
filepath
(str
) –Path where to save the JSON file
-
indent
(int
, default:2
) –Number of spaces for JSON indentation (default: 2)
Source code in src/geosdhydro/_internal/swift.py
87 88 89 90 91 92 93 94 95 |
|
get_parser
¶
get_parser() -> ArgumentParser
Return the CLI argument parser.
Returns:
-
ArgumentParser
–An argparse parser.
Source code in src/geosdhydro/_internal/cli.py
30 31 32 33 34 35 36 37 38 39 |
|
main
¶
Run the main program.
This function is executed when you type geosdhydro
or python -m geosdhydro
.
Parameters:
Returns:
-
int
–An exit code.
Source code in src/geosdhydro/_internal/cli.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
|