Skip to content

implement universal solution for kml viewpoint#771

Draft
tsteven4 wants to merge 9 commits into
GPSBabel:masterfrom
tsteven4:welzl
Draft

implement universal solution for kml viewpoint#771
tsteven4 wants to merge 9 commits into
GPSBabel:masterfrom
tsteven4:welzl

Conversation

@tsteven4
Copy link
Copy Markdown
Collaborator

@tsteven4 tsteven4 commented Nov 26, 2021

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.

Use welzl's algorithm and nvectors to find the latitude, longitude,
and range for the camera.  This works everywhere on earth, including
the antimeridian and poles.
There is a reproducibility issue with very small changes depeding
on the randomization.
@tsteven4 tsteven4 marked this pull request as draft November 26, 2021 16:11
Also, only print kml range to the millimeter instead of micrometer.
At the micrometer level the range could depend on the randomization
of the points for the welzl algorithm.
@GPSBabelDeveloper GPSBabelDeveloper changed the title implement univeresal solution for kml viewpoint implement universal solution for kml viewpoint Nov 27, 2021
@tsteven4
Copy link
Copy Markdown
Collaborator Author

At the moment regression passes except for 64 bit windows builds. They fail with a stack overflow.

More critically, the expected linear performance has not been realized.

@tsteven4
Copy link
Copy Markdown
Collaborator Author

performance appears linear if the set of points is in a hemisphere. However, if the set of points does not fit in any half sphere it becomes very non-linear.

memory utilization also seems to be an issue somewhere above 10,000 points.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant