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

[FEATURE REQUEST / question] ellipsoidal model for distance #14

Open
kkdd opened this issue Jul 3, 2022 · 4 comments
Open

[FEATURE REQUEST / question] ellipsoidal model for distance #14

kkdd opened this issue Jul 3, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@kkdd
Copy link

kkdd commented Jul 3, 2022

Hello,
For mitigating the distortion error in distance, $r$, arisen from spherical model (= S2 geometry), I think that ellipsoidal model would be better, and it would traditionally consist of the following:

Do you have any ideas about it?

  • Ellipsoidal model is differentially (i.e., in short range) represented as follows:

$$ \begin{align} dr &= \sqrt{dE^2+dN^2} \\ dE &= \left(\frac{R}{\sqrt{1-e^2\sin^2 \phi }}\right) \cos \phi d \lambda \\ dN &= \left(\frac{R\ (1- e^2)}{\left(1-e^2 \sin^2 \phi\right)^{3/2}}\right) d \phi \\ \end{align} $$

  • The Braun projection is represented as follows:

$$ \begin{align} x &= R\lambda \\ y &= 2 R \tan \frac{\phi}{2} \\ \chi &= \tan \frac{\phi}{2} \\ d \phi &= \frac{2}{1 + \chi^2} d \chi \\ \cos \phi &= \frac{1 - \chi^2 }{1 + \chi^2}\\ \sin \phi &= \frac{2 \chi}{1 + \chi^2} \end{align} $$

@kkdd kkdd added the enhancement New feature or request label Jul 3, 2022
@kkdd kkdd assigned LdDl Jul 3, 2022
@LdDl
Copy link
Owner

LdDl commented Jul 4, 2022

Hi!
Remark: unfortunately, I'm not that GIS guy, who knows a lot about projections (even knowing some PostGIS stuff).

  1. I do like an idea to replace B-tree search with R-tree (or even better Quad-tree), but how does this affect performance in terms of searches per second?
  2. Are there any "Mercator vs Gall (Braun)" discussions where I can find pros/cons of each projection?

@kkdd
Copy link
Author

kkdd commented Jul 4, 2022

Hi,
Thank you for your comment.

I'm sorry that I don't have a clear idea about the comparison of the search performance between the following:

  • B-tree based on S2geometry
  • R-tree based on cylindrical projection (simply using longitude and latitude)

(R-tree performance has been discussed in literature.)

And we can't see performance discussions about projection, unfortunately.

But the simple use of latitude $\phi$ has the disadvantage in performance when calculating differential, or short-range, distance if based on ellipsoidal model because of the existence of trigonometric functions:

$$ \begin{align} dr &= \sqrt{dE^2+dN^2} \\ dE &= \left(\frac{R}{\sqrt{1-e^2\sin^2 \phi }}\right) \cos \phi d \lambda \\ dN &= \left(\frac{R\ (1- e^2)}{\left(1-e^2 \sin^2 \phi\right)^{3/2}}\right) d \phi \\ \end{align} $$

An idea against for above would be that all of $\cos \phi \textrm{\ and} \cos \phi$ in the coordinates in map data would be calculated in the preprocess stage.

  • I additionally realized that $\cos \phi \textrm{\ and} \cos \phi$
    are arithmetically calculated from $\tan \frac{\phi}{2}$, shown in above (=$\chi$), which is called Braun projection.

@LdDl
Copy link
Owner

LdDl commented Jul 6, 2022

Well, I keep an eye on it. Is this correct definition of Braun proj?

+proj=cea +lon_0=0 +x_0=0 +y_0=0 +lat_ts=45 +ellps=WGS84 +datum=WGS84 +units=m +no_defs

I want to play with it within the instruments like QGIS/ArcGIS/PostGIS

P.s. I've found little Quora disscusions about Gall-Peters(Braun) vs Mercator:
https://www.quora.com/What-is-the-difference-between-Mercator-and-Gall-Peters-projection
https://www.quora.com/Which-map-is-useful-and-good-between-Mercator-projection-and-Peters-projection

@kkdd
Copy link
Author

kkdd commented Jul 6, 2022

Hi,
An above-mentioned idea is for avoiding trigonometric calculation for distance in the differential, or short-range, sense.

I have no idea about the definition of Braun projection in proj.
But in the following demonstration, I used the conversion of latitude, $\chi = 2 \tan \frac{\phi}{2}$, but didn't calculated any distance:

PS. Mercator projection (and Gudermannian function) can be represented by using $\tan \frac{\phi}{2}$, also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants