Label Placement Collision Overlap Detector Two Labels
Pairwise axis-aligned rectangular label collision area; glyph contours, rotations and global placement omitted.
Description
Calculate the shared area of two axis-aligned label rectangles and flag positive-area collisions.
Two map labels can be screened for collision by approximating each as an axis-aligned rectangle. Positive shared area counts as a collision under this tool's convention; touching edges alone do not.
When to use this tool
Calculate the shared area of two axis-aligned label rectangles and flag positive-area collisions. Use it when the input measurements and conventions below match the operation you need.
- Prepare labelABoundsMm, labelBBoundsMm, respecting the measurement basis and boundaries below.
- Compare the worked example with your intended operation before reusing its result.
How to use the tool and how it works
- Enter every field in the input table using the stated units and exact supported selector spelling where applicable.
- Run the tool. Correct input errors before interpreting an output.
- Read the result fields below; use accompanying flags and the stated sign, boundary or model convention when interpreting a number.
Supply each bound list in the order [minimum x, minimum y, maximum x, maximum y], in millimeters. After checking ordered corners, the tool clips each intersection extent to zero, multiplies width by height, and sets positiveAreaCollision only when the product is greater than zero.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| labelABoundsMm | Label a bounds mm. Millimeters. | List of finite numbers |
| labelBBoundsMm | Label b bounds mm. Millimeters. | List of finite numbers |
| Output field | Interpretation |
|---|---|
| result | Object containing the following named result fields. |
| result.overlapAreaMm2 | Overlap area mm2; use the stated units and sign convention. |
| result.positiveAreaCollision | True only when the axis-aligned label rectangles share positive area. |
{
"input": {
"labelABoundsMm": [
0,
0,
3,
2
],
"labelBBoundsMm": [
2,
1,
4,
3
]
},
"output": {
"result": {
"overlapAreaMm2": 1,
"positiveAreaCollision": true
}
}
} Limitations and assumptions
- The rectangles must already be measured in the same coordinate system. Rotated labels, curved glyph outlines, halos and required clearance are not modeled.
- Every declared field is required and unexpected fields are rejected. Numeric inputs must be finite; input errors are distinct from a valid false result or an explicitly qualified output.
- Extremely large inputs and nonfinite or excessively large outputs are rejected. List positions reported by the tool use zero-based indices unless stated otherwise.
Alternative or Complementary methods
For a map-layout decision, inspect the rendered map at its intended size as well as its numerical dimensions. For classification or coordinate work, retain the chosen boundary and coordinate conventions with the result. Compare the scope of the nearby tools below before substituting one.
References
Similar or alternative tools
- Curved Label Character Spacing Along Path Calculator
Signed uniform extra intercharacter gap along caller measured path arclength; negative spacing retained, no glyph orientation or kerning model.
- strahler order pair resolver
Strahler Stream Order Pair Merge Resolver: return merged order.