Skip to content

edspdf.utils.alignment

align_box_labels

Align lines with possibly overlapping (and non-exhaustive) labels.

Possible matches are sorted by covered area. Lines with no overlap at all

PARAMETER DESCRIPTION
src_boxes

The labelled boxes that will be used to determine the label of the dst_boxes

TYPE: Sequence[Box]

dst_boxes

The non-labelled boxes that will be assigned a label

TYPE: Sequence[T]

threshold

Threshold to use for discounting a label. Used if the labels DataFrame does not provide a threshold column, or to fill NaN values thereof.

TYPE: float DEFAULT: 1

pollution_label

The label to use for boxes that are not covered by any of the source boxes

TYPE: Any DEFAULT: None

RETURNS DESCRIPTION
List[Box]

A copy of the boxes, with the labels mapped from the source boxes