Skip to content

Absolute Distance Integration - #482

Merged
electrostat merged 4 commits into
pg-absolute-distance-to-destionationfrom
aa-absolute-distance-integration
Nov 10, 2017
Merged

electrostat merged 4 commits into
pg-absolute-distance-to-destionationfrom
aa-absolute-distance-integration

Conversation

@electrostat

Copy link
Copy Markdown
Contributor

Calculate absolute distance and integrate with new APIs

- update TurfMethods
- create method to calculate the absolute distance between event and final destination
- quick checkstyle fix
- connect absolute distanc calculation to all events and return int result
);
MapboxTelemetry.getInstance().addAbsoluteDistanceToDestination(0, departEvent);

calculateAbsoluteDistance(location, routeProgress);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not completely sure why we're calling calculateAbsoluteDistance(location, routeProgress); here.
We're calling it again 👇

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about extracting it to a local variable (e.g. absoluteDistance) instead of passing the call into addAbsoluteDistanceToDestination()?

afterLocations = obtainLocations(afterLoc);
}

private static int calculateAbsoluteDistance(Location currentLocation, RouteProgress routeProgress) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not moving this utility method to DistanceUtils class?

- move method to distance utils and call from there
- utilize local variables

@Guardiola31337 Guardiola31337 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

@Guardiola31337

Copy link
Copy Markdown
Contributor

@electrostat Check CI: Run instrumentation tests on Firebase step failed ❌

@electrostat
electrostat merged commit 065f836 into pg-absolute-distance-to-destionation Nov 10, 2017
@electrostat
electrostat deleted the aa-absolute-distance-integration branch November 10, 2017 18:53
electrostat pushed a commit that referenced this pull request Nov 10, 2017
* add telem absolute distance to destination track support

* Absolute Distance Integration (#482)

* AbsoluteDistance Calculation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants