Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
df-aggregator
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Oleksandr Barabash
df-aggregator
Commits
684d30e8
Commit
684d30e8
authored
Dec 19, 2020
by
Corey Koval
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Performance Improvements
parent
2b83094a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletions
+11
-1
df-aggregator.py
df-aggregator.py
+0
-0
vincenty.py
vincenty.py
+11
-1
No files found.
df-aggregator.py
View file @
684d30e8
This diff is collapsed.
Click to expand it.
vincenty.py
View file @
684d30e8
...
@@ -15,7 +15,7 @@ from math import atan2
...
@@ -15,7 +15,7 @@ from math import atan2
from
math
import
cos
from
math
import
cos
from
math
import
radians
from
math
import
radians
from
math
import
degrees
from
math
import
degrees
from
math
import
sin
from
math
import
sin
,
asin
from
math
import
sqrt
from
math
import
sqrt
from
math
import
tan
from
math
import
tan
from
math
import
pow
from
math
import
pow
...
@@ -24,6 +24,16 @@ a=6378137.0 # radius at equator in meters (WGS-84)
...
@@ -24,6 +24,16 @@ a=6378137.0 # radius at equator in meters (WGS-84)
f
=
1
/
298.257223563
# flattening of the ellipsoid (WGS-84)
f
=
1
/
298.257223563
# flattening of the ellipsoid (WGS-84)
b
=
(
1
-
f
)
*
a
b
=
(
1
-
f
)
*
a
def
haversine
(
lat1
,
lon1
,
lat2
,
lon2
):
# convert decimal degrees to radians
lon1
,
lat1
,
lon2
,
lat2
=
map
(
radians
,
[
lon1
,
lat1
,
lon2
,
lat2
])
# haversine formula
dlon
=
lon2
-
lon1
dlat
=
lat2
-
lat1
c
=
2
*
asin
(
sqrt
(
sin
(
dlat
/
2
)
**
2
+
cos
(
lat1
)
*
cos
(
lat2
)
*
sin
(
dlon
/
2
)
**
2
))
return
c
*
a
def
get_heading
(
coord1
,
coord2
):
def
get_heading
(
coord1
,
coord2
):
lat1
=
radians
(
coord1
[
0
])
lat1
=
radians
(
coord1
[
0
])
lon1
=
radians
(
coord1
[
1
])
lon1
=
radians
(
coord1
[
1
])
...
...
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