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

Added unittests for InternalGeoCentroid #24176

Merged
merged 1 commit into from
Apr 24, 2017

Conversation

martijnvg
Copy link
Member

Relates to #22278

@martijnvg martijnvg added :Analytics/Aggregations Aggregations review >test Issues or PRs that are addressing/adding tests v6.0.0-alpha1 labels Apr 19, 2017
Copy link
Contributor

@colings86 colings86 left a comment

Choose a reason for hiding this comment

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

LGTM I left a note about why we endcode and decode the point we generate but maybe just add a comment to the code for future and then merge?

Map<String, Object> metaData) {
GeoPoint centroid = RandomGeoGenerator.randomPoint(random());
long encodedGeoPoint = GeoPointField.encodeLatLon(centroid.lat(), centroid.lon());
centroid = new GeoPoint(GeoPointField.decodeLatitude(encodedGeoPoint), GeoPointField.decodeLongitude(encodedGeoPoint));
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need to encode to a long and decode back to a GeoPoint here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, we can reuse the current one and just set lat/lon on that. Let me change that.

@martijnvg martijnvg merged commit dabbf5d into elastic:master Apr 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Aggregations Aggregations >test Issues or PRs that are addressing/adding tests v6.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants