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

geoCubic is upside down 🔄 #75

Closed
Fil opened this issue Nov 3, 2024 · 1 comment · Fixed by #76
Closed

geoCubic is upside down 🔄 #75

Fil opened this issue Nov 3, 2024 · 1 comment · Fixed by #76
Labels

Comments

@Fil
Copy link
Member

Fil commented Nov 3, 2024

unit test reality (edit: on Chrome)
cubic reality

(I am completely puzzled)

@Fil Fil added the bug label Nov 3, 2024
@Fil
Copy link
Member Author

Fil commented Nov 10, 2024

OK, this is due to numerical instability when computing:

const c = geoCentroid({
    type:"Polygon", 
    coordinates: [[[0,35.264389682754654],[-90,35.264389682754654],[180,35.264389682754654],[90,35.264389682754654],[0,35.264389682754654]]
  ]
  })

on node, Safari, and Firefox, as tested today, this gives c = [0, 90], but in Chrome it's c = [180, 90]. Both are fine, but our code then rotates by [-c[0], -c[1]] which puts the map upside-down.

Fil added a commit that referenced this issue Nov 10, 2024
… at the north pole, effectively putting the cubic map upside down.

closes #75
@Fil Fil mentioned this issue Nov 10, 2024
@Fil Fil closed this as completed in #76 Nov 10, 2024
@Fil Fil closed this as completed in 7352226 Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

1 participant