kungfoo / geohash-java

Implementation of GeoHashes in java. We try to be/stay compliant to the spec, as far as possible.
Other
981 stars 310 forks source link

Feature - BoundingBox.expandToInclude(WSG84Point) #41

Closed vinerich closed 2 years ago

vinerich commented 4 years ago

Background

At the moment a BoundingBox is only expandable by defining another BoundingBox: public void expandToInclude(BoundingBox other). I recently got a use case where it would be nice to just specify WSG84Points to be included.

Example

Exp. given you have an array of Points that you want to include into a BoundingBox. Just call BoundingBox.expandToInclude(WSG84Point) for each point and you are done.

I would like to do this with the BoundingBox class since it already has the logic to expand the box into the direction with the minimal distance. (since v1.4.0)

Proposal

I'd go for the implemtation by myself and would do a PR for review. Ofc testing will also be included. What do you think?

vinerich commented 4 years ago

@kungfoo Any opinion on this?

kungfoo commented 4 years ago

Yeah, please do it. If that function is useful and does not break any existing API we can add it, no problem.