trying out shifting coordinates#903
Conversation
langsmith
left a comment
There was a problem hiding this comment.
LGTM as a start. I understand what's going on too 😄
|
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); |
There was a problem hiding this comment.
I'd suggest the API can be Coordinate shift(Coordinate coordinate), case the latitude and longitude used to calculate together.
There was a problem hiding this comment.
@lloydsheng Thank you for pointing this out. This will be a pain because we are trying to do this in the constructor.
54533c9 to
c482d8b
Compare
|
@tobrun @LukasPaczos Could you have a look |
|
Update after chatting with @tobrun about this:
|
823e506 to
58ad1fb
Compare
| public interface CoordinateShifter { | ||
|
|
||
| /** | ||
| * Shift coordinagte values according to its algorithm. |
There was a problem hiding this comment.
| * 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. |
There was a problem hiding this comment.
| * 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. |
There was a problem hiding this comment.
| * Unshift coordinagte values according to its algorithm. | |
| * Unshift coordinate values according to its algorithm. |
e9b2123 to
ccdffd2
Compare
| 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); |
There was a problem hiding this comment.
is this change required for this PR specifically?
| } else { | ||
| rawCoordinates = json.getAsJsonArray(); | ||
| } | ||
| rawCoordinates = json.getAsJsonArray(); |
There was a problem hiding this comment.
is this change required for this PR specifically?
ccdffd2 to
6ae4c7c
Compare
|
@osana has expressed that she's comfortable with the state of this pr and that I can go ahead and merge to |
|
@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. |
No description provided.