Skip to content

Rewrite overlap algorithm #177

@enzet

Description

@enzet

Displaying all icons and labels on a map can make it messy and hard to read. Therefore, we need an algorithm to detect overlaps and hide icons and labels with lower priority.

The current overlap algorithm is too primitive and memory-intensive. It checks for overlaps by iterating over all objects for each object.

Proposed approach:

  1. Divide the plane into 4 rectangles.
  2. Subdivide each rectangle into 4 smaller rectangles.
  3. Repeat this process until a specified threshold is reached.
  4. Assign each object to the rectangle it belongs to.
  5. Check for overlaps only among objects within the same rectangle or neighboring rectangles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementAny new feature or improvement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions