-
Notifications
You must be signed in to change notification settings - Fork 5
spatial Voellmy friction model: add VariableVoellmyShapeToRaster to generate rasters from shapes [com6] #1074
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
base: master
Are you sure you want to change the base?
Conversation
…enerate rasters from shapes Adds functionality for generating raster files for mu and xsi values from a DEM and shapefiles including: A main script to rasterize mu and xsi based on polygon shapefiles and attribute fields. A corresponding run script and configuration file for user customization.
|
Hello @dwolfsch! Thanks for opening this PR.
Do see the Hitchhiker's guide to code style |
|
Code Climate has analyzed commit d5624ec and detected 1 issue on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 8.9% (50% is the threshold). This pull request will bring the total coverage in the repository to 69.0%. View more on Code Climate. |
| # Input DEM raster file path | ||
| # Example: /path/to/dem.asc | ||
| dem = | ||
|
|
||
| # Input shapefile for mu | ||
| # Example: /path/to/mu_shapefile.shp | ||
| # be aware, that the attribute name has to be "mu" | ||
| mu_shapefile = | ||
|
|
||
| # Input shapefile for xsi | ||
| # Example: /path/to/xsi_shapefile.shp | ||
| # be aware, that the attribute name has to be "xsi" | ||
| xsi_shapefile = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These need to be setup as with the avalanche Dir info
| # Important: For the variable Voellmy calculations in the com1DFA algorithm to work, it is mandatory, that the files are stored in: | ||
| # avaframe\data\*yourAvalancheDir*\Inputs\RASTERS\ | ||
| # also, the file names need to be of format *_mu.asc and *_xi.asc and both are required and same extent as DEM | ||
| # Output raster mu | ||
| # Example: /path/to/output_mu.asc | ||
| mu_raster = | ||
|
|
||
| # Output raster xsi | ||
| # Example: /path/to/output_xi.asc | ||
| xsi_raster = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would autoset a name based on the avaDir and some extension, so this can be removed
| demShape = demData.shape | ||
|
|
||
| # Helper function to rasterize shapefiles | ||
| def rasterizeShapefile(shapefilePath, defaultValue, attributeName): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function can be moved to ascUtils in in2Trans
| help='Path to the configuration file') | ||
|
|
||
| args = parser.parse_args() | ||
| runMuXsiWorkflow(str(args.configPath)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs to be switched over to avaDir, (best to contact me for more explanation)
Update variableVoellmyShapeToRaster so that inputs are fetched automatically and no file paths are needed
Adds functionality for generating raster files for mu and
xsi values from a DEM and shapefiles including:
A main script to rasterize mu and xsi based on polygon shapefiles and attribute fields.
A corresponding run script and configuration file for user customization