USEPA/elevatr

Retrieve data in a box that spans the date line

Opened this issue · 2 comments

beroe commented

Currently one's input for longitude can only be degrees from 180 to -180, which is fine. However, I want to retrieve data wrapping around the world, but with the left and right edges at 134E instead of at 180.
If I put in 134 as the left boundary, and 133.9 as the right boundary, it flips them and I get a single column of data. I don't know what the subsequent data retrieval calls look like, but it would be nice if we could either enter abs(longitude) > 180 or if the bounds were taken at face value, so a lower number could be on the right side of the range. ... or maybe there is a way to do it with the existing architecture and I just haven't found it... Thanks.

Can you provide an example? Hoping to get some time in a week or two to devote to elevatr. I'll take a look then.

beroe commented

Thanks for the reply.
The premise is that I would like to make global maps where the whole Pacific ocean is shown, not cut at the -180 line. So for example, Japan, or even all of Australia would be intact at the left side. Presently there is no way to cross the meridian line in the retrieval stage — you have to download the 180 to -180 map and then manipulate the matrix afterwards.
In the metR package, they have a special flag called antimeridian=TRUE for enabling data retrieval across the dateline:
getNOAA.bathy(112.1, 112, -89, 89, antimeridian = TRUE)
That will get a frame where the left edge of the dataset is a 112.1° up to 180°, then from -180 to 0° and up to a right edge of 112°.
As far as I can tell from the documentation, on the backend metR is actually doing two retrievals (112.1 to 180; -180 to 112) and grafting them together before delivering them to you.
So I think, especially for anyone working on marine issues or in Australia, etc., this would be a useful feature. I would like to see more maps that don't chop the Pacific into 2/3rds on the left side, and 1/3rd on the right edge of the map, but it is hard to do that (for me, at least) with the package functions available.
Thanks for your development on behalf of the community and for considering my comment.
Tanaka-GGplot-marmap-2000