Skip to content
Snippets Groups Projects
  1. Nov 04, 2014
    • Kevin M. Smith's avatar
      Catch <values> without <value> error. · 67a23d71
      Kevin M. Smith authored
      This catches responses that return <values> without associated <value>.
      
      Example Below: 
        
        url = "http://waterservices.usgs.gov/nwis/iv/?format=waterml,1.1&huc=02&startDT=2014-10-11T00:00:00.000&endDT=2014-10-11T00:30:00.000&parameterCd=00060,00065"
        data <- getWaterML1Data(url)
      
      WaterML Response (chunk)
        <ns1:timeSeries xmlns:ns1="http://www.cuahsi.org/waterML/1.1/" name="USGS:01350080:00065:00011">
        <ns1:sourceInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:SiteInfoType">
        <ns1:siteName>MANOR KILL AT WEST CONESVILLE NEAR GILBOA NY</ns1:siteName>
        <ns1:siteCode network="NWIS" agencyCode="USGS">01350080</ns1:siteCode>
        <ns1:timeZoneInfo siteUsesDaylightSavingsTime="false">
        <ns1:defaultTimeZone zoneOffset="-05:00" zoneAbbreviation="EST"/>
        <ns1:daylightSavingsTimeZone zoneOffset="-04:00" zoneAbbreviation="EDT"/>
        </ns1:timeZoneInfo>
        <ns1:geoLocation>
        <ns1:geogLocation xsi:type="ns1:LatLonPointType" srs="EPSG:4326">
        <ns1:latitude>42.37694444</ns1:latitude>
        <ns1:longitude>-74.4130556</ns1:longitude>
        </ns1:geogLocation>
        </ns1:geoLocation>
        <ns1:siteProperty name="siteTypeCd">ST</ns1:siteProperty>
        <ns1:siteProperty name="hucCd">02020005</ns1:siteProperty>
        <ns1:siteProperty name="stateCd">36</ns1:siteProperty>
        <ns1:siteProperty name="countyCd">36095</ns1:siteProperty>
        </ns1:sourceInfo>
        <ns1:variable ns1:oid="45807202">
        <ns1:variableCode network="NWIS" vocabulary="NWIS:UnitValues" default="true" variableID="45807202">00065</ns1:variableCode>
        <ns1:variableName>Gage height, ft</ns1:variableName>
        <ns1:variableDescription>Gage height, feet</ns1:variableDescription>
        <ns1:valueType>Derived Value</ns1:valueType>
        <ns1:unit>
        <ns1:unitCode>ft</ns1:unitCode>
        </ns1:unit>
        <ns1:options>
        <ns1:option name="Statistic" optionCode="00011"/>
        </ns1:options>
        <ns1:noDataValue>-999999.0</ns1:noDataValue>
        </ns1:variable>
        <ns1:values>
        <ns1:method methodID="1">
        <ns1:methodDescription>[backup from well]</ns1:methodDescription>
        </ns1:method>
        </ns1:values>
        <ns1:values>
        <ns1:value qualifiers="P" dateTime="2014-10-11T00:00:00.000-05:00">0.85</ns1:value>
        <ns1:value qualifiers="P" dateTime="2014-10-11T00:15:00.000-05:00">0.85</ns1:value>
        <ns1:value qualifiers="P" dateTime="2014-10-11T00:30:00.000-05:00">0.85</ns1:value>
        <ns1:qualifier qualifierID="0" ns1:network="NWIS" ns1:vocabulary="uv_rmk_cd">
        <ns1:qualifierCode>P</ns1:qualifierCode>
        <ns1:qualifierDescription>Provisional data subject to revision.</ns1:qualifierDescription>
        </ns1:qualifier>
        <ns1:method methodID="12">
        <ns1:methodDescription/>
        </ns1:method>
        </ns1:values>
        </ns1:timeSeries>
      67a23d71
  2. Oct 21, 2014
  3. Oct 13, 2014
  4. Oct 10, 2014
Loading