-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
date line crossing animals, mapping functions centered on 0 #2
Comments
Every function in the package works with any kind of coordinates/projections - not just latitude/longitude. Results are always in the same units as the input. When you have data where this is a problem, you have to shift the longitude coordinates to be between e.g. 0 and 360 with something like: y <- ifelse(x < 0, x + 360, x) It is not just an issue for plotting but also for fitting the movement models. If you want the results back between -180 and 180, you can extract both fitted and observed positions using the x <- ifelse(y > 180, y - 360, y) |
Gotcha, thanks. I tend to convert to 360, but you never know what a package has built in. In the package an error check if longitudes cross the dateline and an automatic conversion to 360 if this condition is met, or an explanation in the vignette where lats/longs are used as the example could be useful. Some animal movement functions have you indicate if you are using lat/long ("ll") and this would trigger the error check. Thanks for the great work.
… On Mar 28, 2018, at 5:28 AM, Christoffer Moesgaard Albertsen ***@***.***> wrote:
Every function in the package works with any kind of coordinates/projections - not just latitude/longitude. Results are always in the same units as the input.
As a consequence, the functions don't "know" that longitudes -180 and 180 are the same; every function will treat them as 360 degrees apart.
When you have data where this is a problem, you have to shift the longitude coordinates to be between e.g. 0 and 360 with something like:
y <- ifelse(x < 0, x + 360, x)
It is not just an issue for plotting but also for fitting the movement models. If you want the results back between -180 and 180, you can extract both fitted and observed positions using the getTrack function and transform using something like:
x <- ifelse(y > 180, y - 360, y)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
The plotting functions currently do not allow for date-line crossing (i.e. Pacific Ocean centered data in which the origin is 180 longitude). This makes it difficult to use the built in visualization functions for my data which cross the Pacific. Are there additional implications of this? I would have thought the lat and long data would have needed to be projected. Thanks very much!
The text was updated successfully, but these errors were encountered: