-
Notifications
You must be signed in to change notification settings - Fork 31
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
Analyze Terrain #2586
Analyze Terrain #2586
Conversation
This pulls in support for the RasterSummary operation introduced in WikiWatershed/mmw-geoprocessing#79. This will be used for Terrain analysis.
I see the logic of the transposed table, but all of our other Analyze tables have the variable names & units on the top, so this should match. Let's keep it to matching the mockup. The data source name should be: "NHDPlus V2 NEDSnapshot DEM" |
Setting this up to review. |
Are we adjusting the size of the panel as part of this work or will we do that subsequently? As pictured above the Terrain tab currently goes onto a second row and when "Point Sources" or "Water Quality" is highlighted, both "Terrain" and "Streams" are sent to the second row. |
I think subsequently. @jfrankl is tagged for visual review here, and if he has any immediate suggestions I'll implement, but I've also heard talk that we may be dropping some analyses, which will make room. |
Starts a job to produce summary statistics for elevation and slope in a | ||
given area. | ||
|
||
TODO Where does the NED and Slope data come from? |
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.
cc @arottersman -- do you know the answer to this?
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.
NED data comes from NHDPlus V2 NEDSnapshot, and Slope data is from NED (National Elevation Dataset)
categories = [ | ||
dict(type='average', | ||
elevation=(result[0]['avg'] * M_PER_CM), | ||
slope=result[1]['avg']), |
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 is probably fine since we're just unpacking the results but if we wanted to assign these beforehand I think we could do:
[elevation, slope] = result
categories = [
...
and then use elevation
and slope
in place of result[0]
& result[1]
. Arguable whether that's an improvement, though.
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 like it! Will fix.
@log_request | ||
def start_analyze_terrain(request, format=None): | ||
""" | ||
|
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.
Should this have a docstring?
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.
Good catch meant to put that in.
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.
+1. LGTM.
May be worth figuring out the proper text for those docstrings before merging since we may not come back just to fix those if they aren't set here.
Fixed source name, docstrings, and code style. Going to squash and merge shortly. |
Including an endpoint, Celery task, and Geoprocessing template.
Including table templates, analyze result view, census model, and add to set of MMW Analyze tasks.
50c83e7
to
e0bf8cb
Compare
Overview
Adds a Terrain tab to the Analyze stage. This uses the new
RasterSummary
operation in the geoprocessing service to get summary statistics for Elevation and Slope rasters.Connects #2346
Demo
Also tagging @ajrobbins and @jfrankl for visual review.
Notes
There are no related visual layers corresponding to this tab currently
Can someone confirm the data source name? I took it from the mockup but want to make sure, and add it to the API doc.
At first I made the transposed table, which felt more natural in my mind:
Later I corrected it according to the mockup. The correction code is in the last two fixups, so can be easily reverted if we like this version better.
Testing Instructions
Check out this branch and reprovision worker to install the new geoprocessing service
Go to :8000/ and select an area of interest. Proceed to Analyze.
Ensure you see a Terrain tab under Analyze. Ensure it has reasonable values. Ensure its design matches this mockup