horizon
horizon copied to clipboard
[FEATURE REQUEST / question] ellipsoidal model for distance
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:
- ellipsoidal model + cylindrical projection (e.g., Braun projection) + R-tree (e.g., Priority R-Tree)
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} $$
Hi! Remark: unfortunately, I'm not that GIS guy, who knows a lot about projections (even knowing some PostGIS stuff).
- 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?
- Are there any "Mercator vs Gall (Braun)" discussions where I can find pros/cons of each projection?
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.
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
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:
- r-tree.js and draggable demonstration (bl.ocks.org)
PS. Mercator projection (and Gudermannian function) can be represented by using $\tan \frac{\phi}{2}$, also.