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

Slides:



Advertisements
Similar presentations
BI Web Intelligence 4.0. Business Challenges Incorrect decisions based on inadequate data Lack of Ad hoc reporting and analysis Delayed decisions.
Advertisements

The National Hydrologic Dataset Brian Brodeur GIS Program Director Mass DEP
Measuring and reporting outcomes for your BTOP grant 1Measuring and Reporting Outcomes.
CS 280 Data Structures Professor John Peterson. Goals Understand “Programming in the small” Java programming Know what’s under the hood in complex libraries.
CS 280 Data Structures Professor John Peterson. Goals Understand “Programming in the small” Java programming Know what’s under the hood in complex libraries.
® IBM Software Group © 2006 IBM Corporation The Eclipse Data Perspective and Database Explorer This section describes how to use the Eclipse Data Perspective,
Portfolio Manager—ICBA Members ENERGY STAR  Tools For Benchmarking and Tracking Energy Use.
System for Administration, Training, and Educational Resources for NASA SATERN Overview for Learners May 2006.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
TECHNICAL DOCUMENTATIONPARTNERS DOWNLOAD DATA Download water quality data in MS Excel, CSV, TSV, and KML formats. Learn how to use the portal and data.
U.S. Environmental Protection Agency WATERS Status Update
Network Analysis with Python
CS 122 Engineering Computation Lab Lab 2 Dan De Sousa and Tim Cheeseman Department of Computer Science Drexel University April 2009 ©By the author. All.
1 CSC 221: Introduction to Programming Fall 2012 Functions & Modules  standard modules: math, random  Python documentation, help  user-defined functions,
Internet and Distributed Representation of Agent Based Model by- Manish Sharma.
Enabling High-Quality Printing in Web Applications
Leveraging ArcGIS Online Elevation and Hydrology Services
Python – Part 1 Python Programming Language 1. What is Python? High-level language Interpreted – easy to test and use interactively Object-oriented Open-source.
CSc2310 tutoring session, week 8 Fall, 2012 Haidong Xue 5:30pm—8:30pm 11/06/2012 and 11/07/2012 -Test 3 Study Guide.
Reading and Mapping Aerosol Data From a MODIS HDF4 File
Using and modifying plan constraints in Constable Jim Blythe and Yolanda Gil Temple project USC Information Sciences Institute
1 Batch Indexing, Enviromapper, Web Services, and GIS Tools Randy Hill, Kevin Christian US EPA OWOW/AWPD/MB November 28, 2007.
Data Model / Database Implementation (continued) Jeffery S. Horsburgh Hydroinformatics Fall 2014 This work was funded by National Science Foundation Grants.
June 2013 BIG DATA SCIENCE: A PATH FORWARD. CONFIDENTIAL | 2  Data Science Lead.
Installing AquaTracker. Quick guide to the Program Interface.
For Loop GCSE Computer Science – Python. For Loop The for loop iterates over the items in a sequence, which can be a string or a list (we will discuss.
Lecture 11 Introduction to R and Accessing USGS Data from Web Services Jeffery S. Horsburgh Hydroinformatics Fall 2013 This work was funded by National.
Pima County’s Building Inspector Routing Apps What is the vehicle routing problem (VRP)? Organizations service orders with a fleet of vehicles. Need.
Web Analytics Fundamentals Presented by Tejaswi, Chandrika, Sunil.
Using Python to Retrieve Data from the CUAHSI HIS Web Services Jeffery S. Horsburgh Hydroinformatics Fall 2015 This work was funded by National Science.
Bdsfbdsfb NHDPlus for Corpus Christi Bay Term Project Report Nishesh Mehta Nishesh Mehta 21 st November st November 2006.
PSU Web Conference '12 Erica Hollis The Future is mobile Responsive Web Design Mobile Planning JQuery in World Campus Usability Testing Gamification Making.
Using Python to Retrieve Data from the CUAHSI HIS Web Services Jon Goodall Hydroinformatics Fall 2014 This work was funded by National Science Foundation.
Lesson 11: Web Services and API's
Python Programming Challenge
Automating Entering Data in WEAP and Scenario Analysis
Lecture 19 Automating Preparing and Entering Model Data in WEAP
Using Python to Interact with the EPA WATERS Web Services
Intro to Python Programming – Part II
Python: Control Structures
CUAHSI HIS Sharing hydrologic data
Basic Training May 2016.
Lesson 11: Web Services & API's
Initial Adaptation of the Advanced Regional Prediction System to the Alliance Environmental Hydrology Workbench Dan Weber, Henry Neeman, Joe Garfield and.
CompSci 101 Introduction to Computer Science
Data Virtualization Tutorial: JSON_TABLE Queries
Kapi’olani Community College
QAD Reporting Framework
IPC144 Introduction to Programming Using C Week 2 – Lesson 1
Assignment 4 For this assignment refer to the notes on MATLAB from an MIT course that you can find here (or at the original website, lectures 14, 15, 16).
Lesson 11: Web Services and API's
Lesson 10: Dictionaries Class Chat: Attendance: Participation
CC La Web de Datos Primavera 2018 Lecture 8: SPARQL [1.1]
IPC144 Introduction to Programming Using C Week 4 – Lesson 1
Python Basics with Jupyter Notebook
Recitation on AdFisher
Network Analysis using Python
Programming Challenge Problem
Art 222 Digital Multimedia In-class Presentation Week 14B
Kapi’olani Community College
Arrays & Loops.
ECU Foundation Xtender Application
IST256 : Applications Programming for Information Systems
CMPT 120 Lecture 15 – Unit 3 – Graphics and Animation
Lecture 20 – Practice Exercises 4
Lecture 20 – Practice Exercises 4
Chapter 1: Creating a Program.
H446 Computer Science.
A peer review/grading system for use with Scratch (SPRAT) Dr
CMPT 120 Lecture 26 – Unit 5 – Internet and Big Data
Presentation transcript:

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 1135482 and EPS 1208732

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

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.

We will use two different services Point Indexing Service: http://water.epa.gov/scitech/datait/tools/waters/services/point-indexing-service.cfm Navigation Service: http://water.epa.gov/scitech/datait/tools/waters/services/navigation_service.cfm

Example of Point Indexing Service Index a point to an NHD reach feature using its lat/lon coordinates http://ofmpub.epa.gov/waters10/PointIndexing.Service?pGeometry=POINT(-77.05381041798475+38.88476623745377)&pGeometryMod=WKT%2CSRID%3D8265&pResolution=3&pPointIndexingMethod=DISTANCE&pPointIndexingMaxDist=25&pOutputPathFlag=FALSE&pReturnFlowlineGeomFlag=FALSE&optNHDPlusDataset=2.1&optCache=1415731048364&optJSONPCallback=

Response

Repeat for a second point http://ofmpub.epa.gov/waters10/PointIndexing.Service?pGeometry=POINT(-77.03252440724562+38.82086576259107)&pGeometryMod=WKT%2CSRID%3D8265&pResolution=3&pPointIndexingMethod=DISTANCE&pPointIndexingMaxDist=25&pOutputPathFlag=FALSE&pReturnFlowlineGeomFlag=FALSE&optNHDPlusDataset=2.1&optCache=1415731049646&optJSONPCallback=

Call Navigation Service Based on Response of Two Point Indexing Services http://ofmpub.epa.gov/waters10/Navigation.Service?pNavigationType=PP&pStartPermanentIdentifier=22341029&pStartMeasure=43.47439&pStopPermanentIdentifier=22340577&pStopMeasure=62.92768&pReturnFlowlineAttr=TRUE&optNHDPlusDataset=2.1&optCache=1415731050350&optJSONPCallback=

Response from Navigation Service totaldist = 8.1481878275 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.

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: https://raw.githubusercontent.com/goodalljl/hydroinformatics_class/master/Class22_NHDFlowlineDistanceTool.py

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.

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.

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: http://www.unidata.ucar.edu/software/netcdf/ http://en.wikipedia.org/wiki/NetCDF You may also benefit from browsing the Python sample codes on this page: http://www.unidata.ucar.edu/software/netcdf/examples/programs/