Skip to content
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

Open
autumnlynn opened this issue Mar 28, 2018 · 2 comments
Open

date line crossing animals, mapping functions centered on 0 #2

autumnlynn opened this issue Mar 28, 2018 · 2 comments

Comments

@autumnlynn
Copy link

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!

@calbertsen
Copy link
Owner

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)

@autumnlynn
Copy link
Author

autumnlynn commented Mar 28, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants