Presentation is loading. Please wait.

Presentation is loading. Please wait.

Using Python to Interact with the EPA WATERS Web Services (part 2)

Similar presentations


Presentation on theme: "Using Python to Interact with the EPA WATERS Web Services (part 2)"— Presentation transcript:

1 Using Python to Interact with the EPA WATERS Web Services (part 2)
Jon Goodall Hydroinformatics Fall 2014 This work was funded by National Science Foundation Grants EPS and EPS

2 Review of Last Class We used the EPA Watershed Assessment, Tracking & Environmental Results System (WATERS) Web services to create a Python script that will geocode a NHD feature given its name and state. You learned about using REST and JSON for Web services

3 Today’s Class We will build a Python tool capable of returning the flowline distance between two points given the lat/lon coordinates for the two points.

4 We will use two different services
Point Indexing Service: Navigation Service:

5 Example of Point Indexing Service
Index a point to an NHD reach feature using its lat/lon coordinates

6 Response

7 Repeat for a second point

8

9 Call Navigation Service Based on Response of Two Point Indexing Services

10 Response from Navigation Service
totaldist = km The totaldist parameter is a running total of the navigation across all 6 reaches. So to get the total length of the river between the two points, you get the last element in the ntNavResultsStandard list and look at its totaldist parameter.

11 Creating a Python tool to find the distance between two points on a river
Have the user input two lat/lon points on a river network. Use the Point Indexing service to find the reach ComID and Measure for two lat/lon points. Use the Navigation service to find the distance between the two points. Return the distance to the user. We will walk through a solution to this posted here:

12 Challenge Problems Run the script we discussed in class with the default inputs. Check the output with other students in the class. Modify the script with lat/lon locations of interest to you. Use Google Maps to see if the answer is reasonable. Insert print statements throughout the code to gain a better understanding of how the code works.

13 Assignment 9 Available on Canvas now and due in 1 week
Asks you to create your own Python tool that leverages the EPA WATERS web services to perform some simple analysis or extract useful inputs for modeling. Realizing students are at different starting points with programming, it is less important how ‘complex’ your tool is and more important that you challenge yourself. Spend about as much time on this assignment as you have (on average) for your prior assignments.

14 Next Week Using Python to convert NEXRAD radar data from NetCDF format to a CSV format for ingestion into a model. Please spend a few minutes familiarizing yourself with NetCDF: You may also benefit from browsing the Python sample codes on this page:


Download ppt "Using Python to Interact with the EPA WATERS Web Services (part 2)"

Similar presentations


Ads by Google