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

"Bounding boxes" on the sphere #231

Open
asinghvi17 opened this issue Nov 11, 2024 · 3 comments
Open

"Bounding boxes" on the sphere #231

asinghvi17 opened this issue Nov 11, 2024 · 3 comments

Comments

@asinghvi17
Copy link
Member

asinghvi17 commented Nov 11, 2024

From conversation with @aplavin:

In astronomy, one mostly encounters spherical caps and similar regions when working with coordinates that have uncertainties.

The uncertainties can be reported in different ways by different instruments/people, common ones include:

  • point + radius (assuming a circle on the sphere)
  • point + ellipse (+-lon +-lat, assuming the sphere to be locally flat)
  • point + four quarters of ellipse (+- in both lat/lon are different)
  • rectange (lon in a..b, lat in c..d)
  • 2d distribution, typically gaussian (assuming the sphere is flat)
    And common operations are:
  • does a point fall within a region?
  • distance from a point to a region
  • for distribution, evaluate pdf/number of sigmas/cdf at a point
  • plot the region

We should definitely support point-radius and point-ellipse formulations here, and perhaps the four-quadrant formulation as well. This solves one of the main issues I always had with spherical caps, which is that the spherical cap is not as flexible as an extent for extents that are large in one dimension and small in another, or stick-like and straight geometries like rivers.

Ellipsoids on the sphere would fix that nicely. But the math of intersection, point in polygon, etc would be pretty complicated - unless we brute force it.

Going to try and collect some resources on how to deal with this here.

@asinghvi17
Copy link
Member Author

I'm not sure about how this formulation works:

point + four quarters of ellipse (+- in both lat/lon are different)

is this smooth or segmented? would it be easier to represent this as a polygon on the sphere?

@aplavin
Copy link
Contributor

aplavin commented Nov 14, 2024

Not sure I understand what you are asking... Uncertainties can be reported as two numbers for lon and two for lat (four in total), like lon = 123 +0.5 -0.3 and lat = 12 +1.2 -0.2. This has two natural interpretation, either as a rectangle (lon = 122.7 .. 123.5, lat = 11.8 .. 13.2) or as four quarters of an ellipse. Both are used.
I think the resulting ellipse combination boundary is both continuous and smooth automatically, even at the boundaries.

@asinghvi17
Copy link
Member Author

asinghvi17 commented Nov 14, 2024

Ah OK, so this is no longer an ellipse with two axes but rather a unit circle (let's say) that has been scaled differently in each of the four quadrants. That makes sense, thanks! It'd probably be easier to represent this as a polygon, then, but it's definitely possible to have utilities to compute these efficiently.

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

No branches or pull requests

2 participants