bokulich-lab / q2-coordinates

methods for geographic mapping of qiime2 artifact data or metadata
BSD 3-Clause "New" or "Revised" License
2 stars 8 forks source link

FIX: limit latitude/longitude to their maximum allowed values #25

Closed misialq closed 2 years ago

misialq commented 2 years ago

It turns out that sometimes, when the range of coordinates is very wide, the calculated map extent is much higher than what is actually allowed. That results in some NaN values calculated by OpenLayers and breaks the visualization.

This PR fixes that by:

  1. preventing generation of too high extent values (using only a fraction of stdev)
  2. in case still necessary, cropping the ranges to their maximum allowed values

Additionally, copyright headers are updated in a separate commit to reflect year change 🕐 .

Closes #24.

misialq commented 2 years ago

CI is broken on the Q2 library packaging step...

nbokulich commented 2 years ago

thanks @misialq ! works like a charm. Tested on both local scale (test data in this repo) and global scale (Tara Oceans)

nbokulich commented 2 years ago

I also tested the static draw_map visualizer... works as expected with the changes introduced here (on the test data). Does not work with the Tara data, but that's due to an unrelated issue (the resolution is way too high so it's taking forever to draw the map). I will merge this and open a separate issue. [EDIT: the issue already exists: https://github.com/bokulich-lab/q2-coordinates/issues/4]

thermokarst commented 2 years ago

CI is broken on the Q2 library packaging step...

I think you need alpha1 - there is no alpha2 tag. Ah the joys of using alpha software! Thanks for being a guinea pig!

thermokarst commented 2 years ago

cc #27

thermokarst commented 2 years ago

My guess is we'll stabilize to v1 very soon, the API hasn't changed in a while so that'll provide a little more predictability. cc @ebolyen