Polygon Clipping via Spatial Indexing for Viewport Lag Reduction
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing polygon-clipping techniques, such as the Greiner-Hormann method, are inefficient for large point counts, leading to noticeable lag when repositioning a viewport in applications like choropleth maps, as they require O(m*n) time to find intersections between polygons.
Innovation Solution
A system that uses horizontal and vertical indexes to determine intersections between polygons and a clip rectangle, allowing for efficient clipping and display of polygons within a viewport by projecting line segments onto reference lines and maintaining a storage grid to winnow down relevant line segments, thereby reducing the number of segments to analyze.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the Greiner-Hormann polygon-clipping technique is used to find all intersection points between two polygons, then the clipping operation can be performed, but the time complexity becomes O(m*n) which is too slow for large point counts
Solution Approach 1:
The patent segments the clipping problem by dividing the set of line segments into two groups: candidate segments (those that may intersect the clip rectangle) and non-candidate segments. This segmentation is achieved by using spatial indexes (R-trees) to identify only those line segments whose bounding boxes intersect with the clip rectangle, thereby reducing the number of segments that need to be checked for intersections from O(m) to a much smaller subset.
Solution Approach 2:
The patent performs preliminary actions by pre-computing and storing spatial indexes (R-trees) for the set of line segments before the clipping operation. These indexes organize the line segments based on their spatial locations and bounding boxes, allowing for efficient retrieval of candidate segments during the clipping operation. This preliminary indexing avoids the need to check all line segments during actual clipping.
2Measurement precision
If all line segments are checked for intersections with the clip rectangle, then no intersections are missed, but the number of segments to analyze increases computational complexity
Solution Approach 1:
The patent applies local quality by treating different line segments differently based on their spatial relationship with the clip rectangle. Line segments are categorized into candidate segments (those with bounding boxes intersecting the clip rectangle) and non-candidate segments (those that do not intersect). This local differentiation allows the algorithm to apply intensive intersection checking only to candidate segments while ignoring non-candidate segments, thereby reducing computational complexity while maintaining intersection detection accuracy.
Solution Approach 2:
The patent introduces bounding boxes as an intermediary structure between the line segments and the clip rectangle. Instead of directly checking every line segment against the clip rectangle, the algorithm first checks the bounding boxes of line segments against the clip rectangle. This intermediary bounding box check serves as a filtering mechanism that quickly eliminates non-candidate segments before performing the more computationally expensive line segment intersection tests.
Data Source
AI summary
A system that displays a set of polygons is described. This system obtains a set of line segments that defines the set of polygons. The system forms a horizontal index that keeps track of where line segments vertically project onto a horizontal reference line and similarly forms a vertical index for horizontal projections onto a vertical reference line. The system obtains a clip rectangle that defines a view into the set of polygons and uses the horizontal and vertical indexes to determine intersections between borders of the clip rectangle and line segments in the set of line segments. Next, the system uses the determined intersections to clip polygons in the set of polygons that intersect the clip rectangle. Finally, the system transfers the clipped polygons, and also unclipped polygons that fit completely within the clip rectangle, to a display device that displays the view into the set of polygons.


