Skip to content

Conversation

@tobrun
Copy link
Member

@tobrun tobrun commented May 1, 2019

@tobrun tobrun added the Turf label May 1, 2019
@tobrun tobrun requested a review from osana May 1, 2019 07:00
@tobrun tobrun self-assigned this May 1, 2019
@tobrun tobrun requested a review from langsmith May 1, 2019 08:25
*/
public static BoundingBox square(@NonNull BoundingBox boundingBox) {
double horizontalDistance = distance(
Point.fromLngLat(boundingBox.west(), boundingBox.south()),
Copy link
Contributor

Choose a reason for hiding this comment

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

you can just use boundingBox.southwest() instead of creating a point


if (horizontalDistance >= verticalDistance) {
double verticalMidpoint = (boundingBox.south() + boundingBox.north()) / 2;
return BoundingBox.fromCoordinates(
Copy link
Contributor

Choose a reason for hiding this comment

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

Use BoundingBox.fromLngLats instead of fromCoordinates

);
double verticalDistance = distance(
Point.fromLngLat(boundingBox.west(), boundingBox.south()),
Point.fromLngLat(boundingBox.west(), boundingBox.north())
Copy link
Contributor

Choose a reason for hiding this comment

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

you can just use boundingBox.northeast() instead of creating a point

Copy link
Member Author

Choose a reason for hiding this comment

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

there is no northEast coordinate used

@osana osana modified the milestones: v4.8.0, v4.9.0 May 2, 2019
@tobrun tobrun force-pushed the tvn-turf-square branch from 5726946 to 02ce28f Compare May 17, 2019 11:46
@tobrun tobrun force-pushed the tvn-turf-square branch from 02ce28f to e478955 Compare May 24, 2019 05:52
@tobrun tobrun merged commit ec48710 into master May 24, 2019
@tobrun tobrun deleted the tvn-turf-square branch May 24, 2019 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants