Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Map data parser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWP Datenverwaltung Navigation 2023
Map data parser
Commits
d8c3ce1a
Commit
d8c3ce1a
authored
2 years ago
by
kraleva
Browse files
Options
Downloads
Patches
Plain Diff
add distance in meters
parent
21c139b1
No related branches found
No related tags found
1 merge request
!22
add distance in meters
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mapbuilder/src/main/java/map/builder/utilities/ComputationalUtils.java
+1
-1
1 addition, 1 deletion
...c/main/java/map/builder/utilities/ComputationalUtils.java
with
1 addition
and
1 deletion
mapbuilder/src/main/java/map/builder/utilities/ComputationalUtils.java
+
1
−
1
View file @
d8c3ce1a
...
@@ -20,7 +20,7 @@ public class ComputationalUtils {
...
@@ -20,7 +20,7 @@ public class ComputationalUtils {
// do this for each node and its successor in the (sorted) node list for each
// do this for each node and its successor in the (sorted) node list for each
// segment and then add it all together
// segment and then add it all together
public
static
double
haversine
(
float
lat1
,
float
lon1
,
float
lat2
,
float
lon2
)
{
public
static
double
haversine
(
float
lat1
,
float
lon1
,
float
lat2
,
float
lon2
)
{
final
int
R
=
6371
;
// Radious of the earth
final
int
R
=
6371
000
;
// Radious of the earth
float
latDistance
=
toRad
(
lat2
-
lat1
);
float
latDistance
=
toRad
(
lat2
-
lat1
);
float
lonDistance
=
toRad
(
lon2
-
lon1
);
float
lonDistance
=
toRad
(
lon2
-
lon1
);
float
a
=
(
float
)
(
Math
.
sin
(
latDistance
/
2
)
*
Math
.
sin
(
latDistance
/
2
)
+
float
a
=
(
float
)
(
Math
.
sin
(
latDistance
/
2
)
*
Math
.
sin
(
latDistance
/
2
)
+
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment