| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
MODULE = Geo::Geos PACKAGE = Geo::Geos::Noding |
|
2
|
|
|
|
|
|
|
PROTOTYPES: DISABLE |
|
3
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
int compareOrientedCoordinateArray(Array pts1, Array pts2) { |
|
5
|
2
|
50
|
|
|
|
|
auto seq1 = Helper::convert_coords(pts1); |
|
|
|
50
|
|
|
|
|
|
|
6
|
2
|
50
|
|
|
|
|
auto seq2 = Helper::convert_coords(pts2); |
|
|
|
50
|
|
|
|
|
|
|
7
|
1
|
50
|
|
|
|
|
geos::noding::OrientedCoordinateArray oca{seq1}; |
|
8
|
1
|
50
|
|
|
|
|
RETVAL = oca.compareTo(seq2); |
|
|
|
50
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
} |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
int octant(Sv arg1, SV* arg2) { |
|
12
|
2
|
100
|
|
|
|
|
if (arg1.is_object_ref() && Object(arg1).stash().name() == "Geo::Geos::Coordinate") { |
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
13
|
1
|
50
|
|
|
|
|
auto& c1 = xs::in(arg1); |
|
14
|
1
|
50
|
|
|
|
|
auto& c2 = xs::in(arg2); |
|
15
|
1
|
50
|
|
|
|
|
RETVAL = Octant::octant(&c1, &c2); |
|
16
|
|
|
|
|
|
|
} else { |
|
17
|
1
|
50
|
|
|
|
|
if(!arg1) throw("undef not allowed"); |
|
18
|
1
|
50
|
|
|
|
|
if(!arg2) throw("undef not allowed"); |
|
19
|
1
|
50
|
|
|
|
|
double dx = SvNV(arg1); |
|
|
|
50
|
|
|
|
|
|
|
20
|
1
|
50
|
|
|
|
|
double dy = SvNV(arg2); |
|
|
|
50
|
|
|
|
|
|
|
21
|
1
|
50
|
|
|
|
|
RETVAL = Octant::octant(dx, dy); |
|
22
|
|
|
|
|
|
|
} |
|
23
|
|
|
|
|
|
|
} |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
void checkNodingValid(Array segmentStrigns) { |
|
26
|
2
|
|
|
|
|
|
std::vector v; |
|
27
|
1
|
50
|
|
|
|
|
v.reserve(segmentStrigns.size()); |
|
|
|
50
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
|
29
|
3
|
50
|
|
|
|
|
for (auto it: segmentStrigns) { |
|
|
|
50
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
30
|
2
|
50
|
|
|
|
|
SegmentString& ss = xs::in(it); |
|
31
|
2
|
50
|
|
|
|
|
v.push_back(&ss); |
|
32
|
|
|
|
|
|
|
} |
|
33
|
2
|
50
|
|
|
|
|
NodingValidator nv(v); |
|
34
|
1
|
50
|
|
|
|
|
nv.checkValid(); |
|
35
|
|
|
|
|
|
|
} |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
std::string fastCheckNodingValid(Array segmentStrigns) { |
|
38
|
6
|
100
|
|
|
|
|
std::vector v; |
|
39
|
3
|
50
|
|
|
|
|
v.reserve(segmentStrigns.size()); |
|
|
|
50
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
|
41
|
8
|
50
|
|
|
|
|
for (auto it: segmentStrigns) { |
|
|
|
50
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
42
|
5
|
50
|
|
|
|
|
SegmentString& ss = xs::in(it); |
|
43
|
5
|
50
|
|
|
|
|
v.push_back(&ss); |
|
44
|
|
|
|
|
|
|
} |
|
45
|
6
|
50
|
|
|
|
|
FastNodingValidator fnv{v}; |
|
|
|
100
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
|
47
|
3
|
100
|
|
|
|
|
if (GIMME_V == G_VOID) { |
|
|
|
50
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
48
|
1
|
50
|
|
|
|
|
fnv.checkValid(); |
|
49
|
0
|
|
|
|
|
|
XSRETURN_UNDEF; |
|
50
|
|
|
|
|
|
|
} |
|
51
|
|
|
|
|
|
|
else { |
|
52
|
2
|
50
|
|
|
|
|
if (fnv.isValid()) XSRETURN_UNDEF; |
|
|
|
100
|
|
|
|
|
|
|
53
|
1
|
50
|
|
|
|
|
else RETVAL = fnv.getErrorMessage(); |
|
|
|
50
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
} |
|
55
|
|
|
|
|
|
|
} |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
int compareSegmentPoints(int octant, Coordinate& p1, Coordinate& p2) { |
|
58
|
1
|
50
|
|
|
|
|
RETVAL = SegmentPointComparator::compare(octant, p1, p2); |
|
59
|
|
|
|
|
|
|
} |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Array extractSegmentStrings(Geometry& g) { |
|
62
|
2
|
50
|
|
|
|
|
SegmentString::ConstVect v; |
|
63
|
1
|
50
|
|
|
|
|
geos::noding::SegmentStringUtil::extractSegmentStrings(&g, v); |
|
64
|
|
|
|
|
|
|
|
|
65
|
2
|
50
|
|
|
|
|
Array result = xs::Array::create(v.size()); |
|
|
|
50
|
|
|
|
|
|
|
66
|
2
|
100
|
|
|
|
|
for(auto ss: v) { |
|
67
|
2
|
50
|
|
|
|
|
auto it = xs::out(const_cast(ss)); |
|
68
|
1
|
50
|
|
|
|
|
result.push(it); |
|
69
|
|
|
|
|
|
|
}; |
|
70
|
1
|
50
|
|
|
|
|
RETVAL = result; |
|
71
|
|
|
|
|
|
|
} |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
bool intersects(Array baseSegmentStrings, Array segmentStrings, SV* intDetector = NULL) { |
|
74
|
4
|
|
|
|
|
|
SegmentString::ConstVect vb; |
|
75
|
4
|
50
|
|
|
|
|
for(auto it: baseSegmentStrings) vb.push_back(&xs::in(it)); |
|
|
|
50
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
|
77
|
4
|
|
|
|
|
|
SegmentString::ConstVect v; |
|
78
|
4
|
50
|
|
|
|
|
for(auto it: segmentStrings) v.push_back(&xs::in(it)); |
|
|
|
50
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
|
80
|
4
|
50
|
|
|
|
|
FastSegmentSetIntersectionFinder finder{&vb}; |
|
81
|
2
|
100
|
|
|
|
|
if (!intDetector) RETVAL = finder.intersects(&v); |
|
|
|
50
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
else { |
|
83
|
1
|
50
|
|
|
|
|
auto& id = xs::in(intDetector); |
|
84
|
1
|
50
|
|
|
|
|
RETVAL = finder.intersects(&v, &id); |
|
85
|
|
|
|
|
|
|
} |
|
86
|
|
|
|
|
|
|
} |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
BOOT { |
|
89
|
46
|
50
|
|
|
|
|
xs::exp::autoexport(Stash(__PACKAGE__)); |
|
|
|
50
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
} |