implement universal solution for kml viewpoint #771
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The existing bounding box used to create the kml viewpoints has problems at the poles and antimeridian. It aslo has problems at whenever the bounding box has both positive and negative longitudes, even around the prime meridian.
The intent is to solve these issues in a universal way, that works for all sets of points on the earth. Specifically, it works for points around the antimeridian and points around the poles. We also fix the bug around the prime meridian.
The proposed solution uses Welzl's algorithm to find the minimum bounding "circle" (actually a spherical cap) of the points. It implements this in n-vector space. Welzl's algorithm is O(n), so this solution should scale. I beleive the combination of the Welzl algorithm with n-vector representation of position is novel.
At present there are some reproducibility issues due to randomization of the order of the points. This appears to introduce very small errors in some of the reference files.