Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Joseph Siddons
GeoSpatialTools
Commits
49c58903
Commit
49c58903
authored
5 months ago
by
Joseph Siddons
Browse files
Options
Download
Email Patches
Plain Diff
test(ellipse): add additional boundary tests
parent
8507d8e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
test/test_octtree.py
test/test_octtree.py
+12
-2
test/test_quadtree.py
test/test_quadtree.py
+11
-0
No files found.
test/test_octtree.py
View file @
49c58903
...
...
@@ -136,6 +136,8 @@ class TestOctTree(unittest.TestCase):
theta
=
0
d
=
datetime
(
2023
,
3
,
24
,
12
,
0
)
dt
=
timedelta
(
days
=
10
)
test_datetime
=
d
+
timedelta
(
hours
=
4
)
test_timedelta
=
timedelta
(
hours
=
5
)
ellipse
=
Ellipse
(
...
...
@@ -147,8 +149,16 @@ class TestOctTree(unittest.TestCase):
ellipse
.
p2_lat
,
)
d
=
datetime
(
2023
,
3
,
24
,
12
,
0
)
dt
=
timedelta
(
days
=
10
)
# TEST: Near Boundary Points
assert
ellipse
.
contains
(
Record
(
13.49
,
2.5
,
test_datetime
))
assert
ellipse
.
contains
(
Record
(
11.51
,
2.5
,
test_datetime
))
assert
ellipse
.
contains
(
Record
(
12.5
,
2.99
,
test_datetime
))
assert
ellipse
.
contains
(
Record
(
12.5
,
2.01
,
test_datetime
))
assert
not
ellipse
.
contains
(
Record
(
13.51
,
2.5
,
test_datetime
))
assert
not
ellipse
.
contains
(
Record
(
11.49
,
2.5
,
test_datetime
))
assert
not
ellipse
.
contains
(
Record
(
12.5
,
3.01
,
test_datetime
))
assert
not
ellipse
.
contains
(
Record
(
12.5
,
1.99
,
test_datetime
))
boundary
=
Rectangle
(
10
,
4
,
d
,
20
,
8
,
dt
)
otree
=
OctTree
(
boundary
,
capacity
=
3
)
...
...
This diff is collapsed.
Click to expand it.
test/test_quadtree.py
View file @
49c58903
...
...
@@ -109,6 +109,17 @@ class TestQuadTree(unittest.TestCase):
ellipse
.
p2_lon
,
ellipse
.
p2_lat
,
)
# TEST: Near Boundary Points
assert
ellipse
.
contains
(
Record
(
13.49
,
2.5
))
assert
ellipse
.
contains
(
Record
(
11.51
,
2.5
))
assert
ellipse
.
contains
(
Record
(
12.5
,
2.99
))
assert
ellipse
.
contains
(
Record
(
12.5
,
2.01
))
assert
not
ellipse
.
contains
(
Record
(
13.51
,
2.5
))
assert
not
ellipse
.
contains
(
Record
(
11.49
,
2.5
))
assert
not
ellipse
.
contains
(
Record
(
12.5
,
3.01
))
assert
not
ellipse
.
contains
(
Record
(
12.5
,
1.99
))
boundary
=
Rectangle
(
10
,
4
,
20
,
8
)
qtree
=
QuadTree
(
boundary
,
capacity
=
3
)
points
:
list
[
Record
]
=
[
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment