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
05912281
Commit
05912281
authored
3 months ago
by
Joseph Siddons
Browse files
Options
Download
Email Patches
Plain Diff
feat: add missing spatial distance method to SpaceTimeRecord class
parent
bfc7c476
main
10-improve-documentation
v0.11.2
v0.11.1
v0.11.0
v0.10.1
v0.10.0
v0.9.0
v0.8.0
v0.7.1
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
GeoSpatialTools/octtree.py
GeoSpatialTools/octtree.py
+9
-0
No files found.
GeoSpatialTools/octtree.py
View file @
05912281
...
...
@@ -80,6 +80,15 @@ class SpaceTimeRecord:
and
(
not
(
self
.
uid
or
other
.
uid
)
or
self
.
uid
==
other
.
uid
)
)
def
distance
(
self
,
other
:
object
)
->
float
:
"""
Compute the Haversine distance to another SpaceTimeRecord.
Only computes spatial distance.
"""
if
not
isinstance
(
other
,
SpaceTimeRecord
):
raise
TypeError
(
"Argument other must be an instance of Record"
)
return
haversine
(
self
.
lon
,
self
.
lat
,
other
.
lon
,
other
.
lat
)
class
SpaceTimeRecords
(
List
[
SpaceTimeRecord
]):
"""List of SpaceTimeRecords"""
...
...
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