ropensci / rerddap

R client for working with ERDDAP servers
https://docs.ropensci.org/rerddap
Other
40 stars 14 forks source link

Include url in info #80

Closed rmendels closed 5 years ago

rmendels commented 5 years ago

@sckott - as long as you might be making changes and resubmitting to CRAN, can you modify info.R to include the URL of the call. All that is need is to add one thing in info.R. Lines 103-107 presently read:

  structure(list(variables=vars, alldata=oo),
            class="info",
            datasetid=datasetid,
            type=table_or_grid(datasetid))
}

Just change to:

  structure(list(url = url, variables=vars, alldata=oo),
            class="info",
            datasetid=datasetid,
            type=table_or_grid(datasetid))
}
sckott commented 5 years ago

sure, can do, but why do you want the URL?

to be sure, what URL do you want: e.g., in this call

info('erdATastnhday')

This is the URL that was used to do the HTTP call:

https://upwell.pfeg.noaa.gov/erddap/info/erdATastnhday/index.json

is that the URL you want or a different one?

rmendels commented 5 years ago

@sckott - The idea is to make the return from rerddap::info() self-contained. If this is added, if a user passes me the result from rerddap::info(), I know the base ERDDAP URL that was used to obtain the result. So rather than requiring the user to pass that to me again, it is now self-contained in the return of rerddap::info(). So in the case you give, the URL would be:

https://upwell.pfeg.noaa.gov/erddap/

I actually brought this up once before. I believe the small patch above correctly includes the URL I am after.

sckott commented 5 years ago

Okay, so the base url for the ERDDAP server, can do

sckott commented 5 years ago

okay, its added

rmendels commented 5 years ago

@sckott Thanks.