Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Distance Calculator with more accuracy #796

Open
dominikriemer opened this issue Nov 26, 2022 · 1 comment
Open

Improve Distance Calculator with more accuracy #796

dominikriemer opened this issue Nov 26, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request migrated from jira Indicates that a issue has been migrated from JIRA (only automatically assigned - Do not modify!) pipeline elements Relates to pipeline elements
Milestone

Comments

@dominikriemer
Copy link
Member

at the moment the Haversine formula is used to calculate the distance between 2 lat/lng spherical points. Using the Vincenty solutions leads to a more accurate result

https://github.com/apache/streampipes/tree/dev/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/processor/staticdistancecalculator

The distance is calculated from a static point
Berlin
lat 52.520008
lng 13.404954

||city|| distance_sp|| distance Vincenty || alpha ||
|Karlsruhe| 524.871 | 525.735 | -0.864 |
| Sidney | 16094.221| 16088.138 | 6.083 |
|Hamburg | 255.306 | 256.015 | -0.709 |
| New York | 6384.996 | 6402.425 | -17.429 |

Backgroundinfo https://www.neovasolutions.com/2019/10/04/haversine-vs-vincenty-which-is-the-best/

Testdata:
[^City_Koords.csv]

Imported from Jira STREAMPIPES-641. Original Jira may contain additional context.
Reported by: micklich.
Subtask of issue #795

@dominikriemer dominikriemer added migrated from jira Indicates that a issue has been migrated from JIRA (only automatically assigned - Do not modify!) sub-task labels Nov 26, 2022
@bossenti bossenti added this to the 1.0.0 milestone Nov 27, 2022
@flomickl
Copy link
Contributor

flomickl commented Jan 6, 2023

My plan is to add this lib to get better performance for calculation and other tasks

https://github.com/geographiclib/geographiclib-java

<!-- https://mvnrepository.com/artifact/net.sf.geographiclib/GeographicLib-Java -->
<dependency>
    <groupId>net.sf.geographiclib</groupId>
    <artifactId>GeographicLib-Java</artifactId>
    <version>2.0</version>
</dependency>

Due to MIT license -> https://geographiclib.sourceforge.io/LICENSE.txt
I think it is safe to add.
It is correct @dominikriemer ?

@bossenti bossenti added enhancement New feature or request pipeline elements Relates to pipeline elements labels Jan 6, 2023
@bossenti bossenti modified the milestones: 0.95.0, post-1.0 Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request migrated from jira Indicates that a issue has been migrated from JIRA (only automatically assigned - Do not modify!) pipeline elements Relates to pipeline elements
Projects
None yet
Development

No branches or pull requests

3 participants