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

Fix track wrapping at edges of map #1163

Merged
merged 3 commits into from
Sep 6, 2024
Merged

Fix track wrapping at edges of map #1163

merged 3 commits into from
Sep 6, 2024

Conversation

JustinElms
Copy link
Contributor

@JustinElms JustinElms commented Sep 6, 2024

Background

As described in Issue #944

Observation tracks often wrap around the map when they cross the edges of the projection. This happens when the track coordinates cross these boundaries leading OpenLayers to place them on opposite side of the map. Eg if the track coordinates change from -178 to 178 degrees longitude. The solution implemented here is to allow the tracks to extend beyond the -180,180 longitude range so that they are plotted continuously. In the previous example the longitude coordinates would be updated from -178, 178 to -178, -182. Logic to handle this was added to the new CMEMS data importers and filters in the API and Stations DB model that shifted coordinates to within these bounds have been removed.

Why did you take this approach?

Correcting the observations data on ingestion reduces the processing needed by the backend. This is a good time to make this change since we're currently in the process of migrating to CMEMS data for our observations.

Screenshot(s)

Glider tracks with original coordinates:
image
Glider tracks with reformatted coordinates:
image

Checks

  • I ran unit tests.
  • I've tested the relevant changes from a user POV.
  • I've formatted my Python code using black ..

@JustinElms JustinElms added Bugfix A fix for something broken. Javascript Python observations Related to observations labels Sep 6, 2024
@JustinElms JustinElms self-assigned this Sep 6, 2024
@JustinElms JustinElms linked an issue Sep 6, 2024 that may be closed by this pull request
@JustinElms JustinElms marked this pull request as ready for review September 6, 2024 16:41
@JustinElms JustinElms merged commit 769acc3 into master Sep 6, 2024
9 checks passed
@JustinElms JustinElms deleted the fix-track-wrapping branch September 6, 2024 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugfix A fix for something broken. Javascript observations Related to observations Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some Argo tracks display points outside of their expected range
1 participant