-
Notifications
You must be signed in to change notification settings - Fork 0
Approximation
Wolren edited this page Apr 30, 2026
·
3 revisions
The Approximation family provides fast area-focused search without strict containment certification.
| Variant | Description | Containment |
|---|---|---|
| Standard | Full geometric search | Not certified |
| Fast | Optimized execution | Not certified |
Both variants share identical semantics—Approximation Fast uses slice-based execution for improved throughput.
flowchart TD
A[Prepare geometry] --> B[Edge-angle candidates]
B --> C[Upper-bound pruning]
C --> D[Coarse grid solve]
D --> E{Candidates weak/ambiguous?}
E -- Yes --> F[Fallback uniform sweep]
E -- No --> G[Angle refinement]
F --> G
G --> H[Fine-grid recompute]
H --> I[Rotate back + optional buffer]
I --> J[Output area/angle/ratio]
- Read polygon geometry
- For multipolygons, use the largest component
- Extract orientation candidates from polygon edge directions
- Creates set of likely optimal orientations
- Compute cheap area upper bound per angle
- Skip weak candidates early
- Run grid search on rotated geometry
- Find current best rectangle at coarse resolution
- If candidates are weak or ambiguous
- Run uniform sweep by ANGLE_STEP across full 180° range
- Bounded scalar optimization around best angle
- Finds local optimum
- Reconstruct rectangle at fine grid resolution
- Rotate back to map orientation
- Apply optional containment buffer
- Export area, angle, and ratio
Approximation algorithms are NOT strict containment solvers. The rectangle can violate containment in difficult cases. Use these for:
- Quick candidate finding
- Exploratory analysis
- Initial screening before using Skeleton/BCRS
| Parameter | Effect on Result |
|---|---|
| GRID_COARSE | Controls initial search resolution |
| GRID_FINE | Controls refinement resolution |
| ANGLE_STEP | Fallback sweep granularity |
| MAX_RATIO | Aspect ratio constraint |
Approximation family is the fastest in LIRiAP:
- Standard: ~7s for 290 features, ~127s for 5406 features
- Fast: ~7s for 290 features, ~126s for 5406 features
- Scales linearly with feature count
Best execution mode: Multithreaded (12 workers) with chunking for large datasets.
Heuristic search patterns based on edge-direction analysis and grid-based sampling.