Skip to content

trying out shifting coordinates#903

Merged
langsmith merged 1 commit into
masterfrom
osana-cn-shifting
Oct 22, 2018
Merged

trying out shifting coordinates#903
langsmith merged 1 commit into
masterfrom
osana-cn-shifting

Conversation

@osana

@osana osana commented Oct 11, 2018

Copy link
Copy Markdown
Contributor

No description provided.

@langsmith langsmith left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM as a start. I understand what's going on too 😄

@zugaldia

Copy link
Copy Markdown
Member

I like how this approach helps decouple the logic downstream. Capturing chat, let's include performance tests to understand any hits coming from the approach in this PR (introducing a default operation in all cases) vs only applying the shifting conditionally vs no changes.


public interface CoordinateShifter {

double shiftLat(double lat);

@lloydsheng lloydsheng Oct 12, 2018

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'd suggest the API can be Coordinate shift(Coordinate coordinate), case the latitude and longitude used to calculate together.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@lloydsheng Thank you for pointing this out. This will be a pain because we are trying to do this in the constructor.

@osana
osana force-pushed the osana-cn-shifting branch 2 times, most recently from 54533c9 to c482d8b Compare October 12, 2018 18:14
@osana

osana commented Oct 12, 2018

Copy link
Copy Markdown
Contributor Author

@tobrun @LukasPaczos Could you have a look
I still need to work on toJson/fromJson adjustments.

@langsmith

langsmith commented Oct 16, 2018

Copy link
Copy Markdown

Update after chatting with @tobrun about this:

  • Getting access to @osana’s work in China plugin

    • Merge @osana’s changes to master
    • In the China Plugin project, I will use 6.6.0 of the Maps SDK and use exclude group as seen in the code example in https://stackoverflow.com/a/36103326/6358488 . I will use exclude group to block usage of the Maps SDK’s regular Java SDK version. I will also add a new dependency line that adds the Java SDK SNAPSHOT, which should include @osana’s shifting work by then.
  • Regarding testing:

    • Timestamp comparison via simple logcat logging (@tobrun mentioned there might be some sort of framework for this)
    • Profiling memory through Android Studio. GC for use in Android Studio. Run tests and see how much memory consumed. Compare to baseline non-shifting.
    • Try to see if there's a way to test CPU usage
    • Seeing the performance of C++ JNI bridge for shifting will be interesting

@osana
osana force-pushed the osana-cn-shifting branch 4 times, most recently from 823e506 to 58ad1fb Compare October 16, 2018 22:52
public interface CoordinateShifter {

/**
* Shift coordinagte values according to its algorithm.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
* Shift coordinagte values according to its algorithm.
* Shift coordinate values according to its algorithm.

List<Double> shiftLonLat(double lon, double lat);

/**
* Shift coordinagte values according to its algorithm.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
* Shift coordinagte values according to its algorithm.
* Shift coordinate values according to its algorithm.

List<Double> shiftLonLatAlt(double lon, double lat, double altitude);

/**
* Unshift coordinagte values according to its algorithm.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
* Unshift coordinagte values according to its algorithm.
* Unshift coordinate values according to its algorithm.

@osana
osana force-pushed the osana-cn-shifting branch 2 times, most recently from e9b2123 to ccdffd2 Compare October 17, 2018 15:07
try {
// Use the current context to deserialize it
Type classType = Class.forName("com.mapbox.geojson." + geometryType);
Type classType = Class.forName("com.mapbox.geojson.AutoValue_" + geometryType);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is this change required for this PR specifically?

} else {
rawCoordinates = json.getAsJsonArray();
}
rawCoordinates = json.getAsJsonArray();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is this change required for this PR specifically?

@osana
osana force-pushed the osana-cn-shifting branch from ccdffd2 to 6ae4c7c Compare October 17, 2018 16:22
@langsmith

Copy link
Copy Markdown

@osana has expressed that she's comfortable with the state of this pr and that I can go ahead and merge to master so that next steps can happen

@langsmith

Copy link
Copy Markdown

@osana expressed her comfort with my merging this, so I'm merging this pr. This will allow for next steps as outlined in my comment above.

@langsmith
langsmith merged commit 5b6d18f into master Oct 22, 2018
@langsmith
langsmith deleted the osana-cn-shifting branch October 22, 2018 07:04
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.

5 participants