Crates.io | anime |
lib.rs | anime |
version | 0.1.2 |
source | src |
created_at | 2024-12-20 15:07:58.314668 |
updated_at | 2024-12-20 22:57:43.106339 |
description | Approximate Network Matching, Integration, and Enrichment |
homepage | |
repository | |
max_upload_size | |
id | 1490261 |
size | 22,046 |
The algorithm works like this:
Let A
and B
be two vectors of LineSring
, Vec<LineString>
.
Let i
refer to the index position of a LineString
in A
and let j
refer to the index position of B
.
For each LineString
in A
or B
, let the index of the component line be k
where Aik
is a Line
.
BTreeMap<usize, Vec<(usize, f64)>>
DT
AT
for i in A:
for k in i:
calculate the slope of Aik
insert Aik with a tuple of (i, slope_Aik) into Tree_A
for j in B:
for k in j:
calculate the slope of Bjk
expand the AABB of Bjk in the x and y direction by DT
insert Bjk with a tuple of (j, slope_Bjk)
atan(slope)
d
be the distance between lines Aik
and Bjk
Aik
and Bjk
is less than DT
, continueAi
is less than or equal to 45
Aik
and Bjk
Aik
based on xmin
and xmax
(xmin, y1)
and (xmax, y2)
i
into the BTreeMap if it does not exist
j
, d
) to the value vector if j
does not existj
is in the value vector, add d
to the f64 valueAi
is greater than 45 degrees
Aik
and Bjk
Aik
based on ymin
and ymax
(x1, ymin)
and (x2, ymax)
i
into the BTreeMap if it does not exist
j
, d
) to the value vector if j
does not existj
is in the value vector, add d
to the f64 value