ropensci / rnoaa

R interface to many NOAA data APIs
https://docs.ropensci.org/rnoaa
Other
330 stars 84 forks source link

RNOAA / SWDI Error: 1: Extra content at the end of the document #274

Closed Orionsic closed 5 years ago

Orionsic commented 6 years ago

Hi, I am trying to retrieve NOAA data for the severe weather data inventory (swdi), however I get this error often:

Extra content at the end of the document
Error: 1: Extra content at the end of the document

For instance, we'll use the example in the SWDI package help menu, then change the date parameters to get the error.

Start Date 05/06/2006, End Date 05/07/2006

> swdi(dataset='nx3tvs', startdate='20060506', enddate='20060507',
+      tile=c(-102.12,32.62))

Result:

$`meta`
$`meta`$`totalCount`
numeric(0)

$`meta`$totalTimeInSeconds
[1] 0

$data
                 ztime wsr_id cell_id cell_type range azimuth max_shear mxdv
1 2006-05-06T00:41:29Z   KMAF      D9       TVS    37       6        39   85
2 2006-05-06T03:56:18Z   KMAF      N4       TVS    39       3        30   73
3 2006-05-06T03:56:18Z   KMAF      N4       TVS    42       4        20   52
4 2006-05-06T04:00:30Z   KMAF      N4       TVS    38       5        35   86
5 2006-05-06T04:04:44Z   KMAF      N4       TVS    41       8        24   62

$shape
                                       shape
1 POINT (-102.112726356403 32.5574494581267)
2  POINT (-102.14873079873 32.5933553250156)
3 POINT (-102.131167022161 32.6426287452898)
4 POINT (-102.123671677514 32.5751241756203)
5 POINT (-102.076389686189 32.6209390786829)

attr(,"class")
[1] "swdi"

Using the same command, let's change the dates to Start Date 01/01/2016, End Date 02/01/2016

swdi(dataset='nx3tvs', startdate='20160101', enddate='20160201',
    tile=c(-102.12,32.62))

Result:

Extra content at the end of the document
Error: 1: Extra content at the end of the document

Any help would be appreciated! Thanks!

Orionsic commented 6 years ago
> session_info()
Session info --------------------------------------------------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.5.1 (2018-07-02)
 system   x86_64, mingw32             
 ui       RStudio (1.1.453)           
 language (EN)                        
 collate  English_United States.1252  
 tz       America/Chicago             
 date     2018-10-04                  

Packages ------------------------------------------------------------------------------------------------------------------------------------------
 package     * version   date       source                            
 assertthat    0.2.0     2017-04-11 CRAN (R 3.5.1)                    
 base        * 3.5.1     2018-07-02 local                             
 bindr         0.1.1     2018-03-13 CRAN (R 3.5.1)                    
 bindrcpp      0.2.2     2018-03-29 CRAN (R 3.5.1)                    
 cli           1.0.0     2017-11-05 CRAN (R 3.5.1)                    
 colorspace    1.3-2     2016-12-14 CRAN (R 3.5.1)                    
 compiler      3.5.1     2018-07-02 local                             
 crayon        1.3.4     2017-09-16 CRAN (R 3.5.1)                    
 curl          3.2       2018-03-28 CRAN (R 3.5.1)                    
 datasets    * 3.5.1     2018-07-02 local                             
 devtools    * 1.13.6    2018-06-27 CRAN (R 3.5.1)                    
 digest        0.6.17    2018-09-12 CRAN (R 3.5.1)                    
 dplyr         0.7.6     2018-06-29 CRAN (R 3.5.1)                    
 ggplot2       3.0.0     2018-07-03 CRAN (R 3.5.1)                    
 glue          1.2.0     2017-10-29 CRAN (R 3.5.1)                    
 graphics    * 3.5.1     2018-07-02 local                             
 grDevices   * 3.5.1     2018-07-02 local                             
 grid          3.5.1     2018-07-02 local                             
 gridExtra     2.3       2017-09-09 CRAN (R 3.5.1)                    
 gtable        0.2.0     2016-02-26 CRAN (R 3.5.1)                    
 hoardr        0.2.0     2017-05-10 CRAN (R 3.5.1)                    
 httr          1.3.1     2017-08-20 CRAN (R 3.5.1)                    
 jsonlite      1.5       2017-06-01 CRAN (R 3.5.1)                    
 lazyeval      0.2.1     2017-10-29 CRAN (R 3.5.1)                    
 lubridate     1.7.4     2018-04-11 CRAN (R 3.5.1)                    
 magrittr      1.5       2014-11-22 CRAN (R 3.5.1)                    
 memoise       1.1.0     2017-04-21 CRAN (R 3.5.1)                    
 methods     * 3.5.1     2018-07-02 local                             
 munsell       0.5.0     2018-06-12 CRAN (R 3.5.1)                    
 ncdf4       * 1.16      2017-04-01 CRAN (R 3.5.0)                    
 pillar        1.2.3     2018-05-25 CRAN (R 3.5.1)                    
 pkgconfig     2.0.1     2017-03-21 CRAN (R 3.5.1)                    
 plyr        * 1.8.4     2016-06-08 CRAN (R 3.5.1)                    
 purrr         0.2.5     2018-05-29 CRAN (R 3.5.1)                    
 R6            2.2.2     2017-06-17 CRAN (R 3.5.1)                    
 rappdirs      0.3.1     2016-03-28 CRAN (R 3.5.1)                    
 Rcpp          0.12.17   2018-05-18 CRAN (R 3.5.1)                    
 rlang         0.2.1     2018-05-30 CRAN (R 3.5.1)                    
 rnoaa       * 0.7.0     2017-05-06 CRAN (R 3.5.1)                    
 rstudioapi    0.7       2017-09-07 CRAN (R 3.5.1)                    
 scales        1.0.0     2018-08-09 CRAN (R 3.5.1)                    
 stats       * 3.5.1     2018-07-02 local                             
 stringi       1.1.7     2018-03-12 CRAN (R 3.5.0)                    
 stringr       1.3.1     2018-05-10 CRAN (R 3.5.1)                    
 tibble        1.4.2     2018-01-22 CRAN (R 3.5.1)                    
 tidyr         0.8.1     2018-05-18 CRAN (R 3.5.1)                    
 tidyselect    0.2.4     2018-02-26 CRAN (R 3.5.1)                    
 tools         3.5.1     2018-07-02 local                             
 utf8          1.1.4     2018-05-24 CRAN (R 3.5.1)                    
 utils       * 3.5.1     2018-07-02 local                             
 weatherData * 0.6.0     2018-10-03 Github (Ram-N/weatherData@4326bdc)
 withr         2.1.2     2018-03-15 CRAN (R 3.5.1)                    
 XML           3.98-1.16 2018-08-19 CRAN (R 3.5.1)                    
 xml2          1.2.0     2018-01-24 CRAN (R 3.5.1)                    
 yaml          2.2.0     2018-07-25 CRAN (R 3.5.1)   
sckott commented 6 years ago

thanks @OrionDarley having a look

sckott commented 6 years ago

@OrionDarley do you know if data should exist for that query that failed?

I'm having a hard time now sorting out what date ranges have data.

anyway, pushed a fix, so that the fxn fails better - saying there's no data for the query when that's the case:

swdi(dataset='nx3tvs', startdate='20160101', enddate='20160201', tile=c(-102.12,32.62))
#> Error in check_response_swdi(temp, format) : no results found
sckott commented 5 years ago

i think this has been addressed