question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Overlapping Voronoi polygons

See original GitHub issue

When I tried to create a Voronoi diagram from a gridded dataset of 4 points (±90, ±45) using geoVoronoi(), the cells seem to overlap. @Fil has graciously pointed out that this is because the polygons have some 180° edges but no intermediate points.

Here’s a minimal, reproducible example: https://observablehq.com/d/1433b09bb55a4807. Ideally, each Voronoi cell should be colored either orange or blue. Would love for a way to fix this. Thanks!

screen_cap

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Filcommented, Nov 17, 2020

With “2 columns”, the points are in fact collinear (all belong to the great circle that passes through the poles and [-90;0]). It’s one of these situations where the (planar) Delaunay triangulation also tends to fail.

A “solution” in that case can be to introduce a supplementary point that is very close to the first point, but not aligned on the same grand circle. (It’s frustrating that the code can’t compute this case on its own, tho.)

1reaction
Filcommented, Nov 15, 2020

I believe this shows two distinct issues:

  1. when we have 2 columns (and whatever the number of rows), geoVoronoi returns ill-defined polygons.

  2. when you request more than two columns, the polygons are OK, but d3.geoEquirectangular (and, it seems, all the projections that rely on antimeridian clipping) fail to display them properly. (You can see that by switching to d3.geoAzimuthalEqualArea in your notebook.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Voronoi diagrams with overlapping regions | SpringerLink
In this paper, we define overlapping Voronoi diagrams so that the Voronoi regions do not partition the plane into disjoint regions.
Read more >
Voronoi diagrams with overlapping regions - ResearchGate
In this paper, we define overlapping Voronoi diagrams so that the Voronoi regions do not partition the plane into disjoint regions.
Read more >
Overlay two Voronoi Diagrams and calculate membership and ...
I want to overlay the Voronoi diagrams on top of each other and calculate the the areas of the intersected polygons as well...
Read more >
Voronoi diagrams with overlapping regions - ProQuest
In this paper, we dene overlapping Voronoi diagrams so that the Voronoi regions do not partition the plane into disjoint regions. Rather, we...
Read more >
Voronoi diagram - Wikipedia
In biology, Voronoi diagrams are used to model a number of different biological structures, including cells and bone microarchitecture. · In hydrology, Voronoi ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found