ropensci / bowerbird

Keep a collection of sparkly data resources
https://docs.ropensci.org/bowerbird
Other
47 stars 6 forks source link

Lake Superior bathymetry #3

Closed mdsumner closed 7 years ago

mdsumner commented 7 years ago

I'm unsure about filtering to a single file, and 'recursive' in the wget args. Might be a good set to explore more broadly. (I want this file in particular for a particular polygon mesh example that I need).

raymondben commented 7 years ago

Just on the "recursive" thing - you probably always want recursive, so that wget creates the directory structure (see README). For a single file you can either do what you've done (point the source_url to the directory and restrict to the file you want by the accept or accept-regex flags), or could just point the source_url directly to the file. The former is probably better, because it's more obvious that the results are being filtered and other users can see more easily how to get different formats, should they want them. Couple of other gotchas: accept only applies to the file name, whereas accept-regex applies to the whole URL. And the source URL needs its trailing slash, for reasons I don't quite understand. Something about how wget recurses over http.

mdsumner commented 7 years ago

Great, that's awesome. The readme is now my go-to authority on wget ;)