Boost logo

Geometry :

Subject: Re: [geometry] Support for geographic coordinate system
From: Barend Gehrels (barend_at_[hidden])
Date: 2014-11-25 13:24:53


Hi Adam,

Adam Wulkiewicz wrote On 23-11-2014 13:54:
> Hi,
>
> Barend Gehrels wrote:
>> Adam Wulkiewicz wrote On 7-11-2014 0:00:
>>> Barend Gehrels wrote:
>>>> Adam Wulkiewicz wrote On 6-11-2014 17:06:
> <snip>
>>>>>
>>>>>>
>>>>>> Basically, to support this CS we need a distance strategy and
>>>>>> side strategy. They're already implemented (more or less) though
>>>>>> in the extensions so not officially released yet. To release them
>>>>>> we need to think about the interface first. The geographical
>>>>>> strategies should have an interface similar to the one used in
>>>>>> spherical strategies.
>>>>>>
>>>>>> GEOGRAPHICAL:
>>>>>>
>>>>>> - a spherical side strategy is just used by default which I guess
>>>>>> should be changed. I think the most precise would be a strategy
>>>>>> finding the side using the geographic courses found using the
>>>>>> inverse Vincenty's formula but this requires some testing
>>>>>
>>>>> As far as I know, the spherical side strategy works for the
>>>>> geographic Earth too, please indicate if that is not the case.
>>>>>
>>>>> See also
>>>>> http://barendgehrels.blogspot.nl/2011/06/spherical-side-formula.html
>>>>>
>>>>> But I might be wrong, it is good to research this.
>>>>
>>>> I feel that Vincenty's formula should give different results in
>>>> some edge cases because the shape of geodesic on ellipsoid is
>>>> different than on a sphere but I must perform some tests to be sure.
>>
>> I'm curious about this.
>
> I've made some quick test where I compared the result of spherical
> side formula and a side found by comparison of azimuths calculated
> using Vincenty's formula. The method comparing azimuths is very simple
> and probably not good enough to be released nevertheless the error is
> too small to be seen in this case. The difference between spherical
> and geographical geodesic seems to be a lot greater.

Thanks! But...
What is the conclusion?
- SSF can only be used for spherical and not for geographic (all
non-spheres)?
- the method comparing azimuths (you mentioned is probably not good
enough) is not sufficient?

I cannot completely read that from your story, but the
color-descriptions indicate the Vincenty azimuth comparisons are OK? It
looks good indeed.

> It's also possible that I made something wrong. In that case don't
> hesitate to point it out :)

bgd::vincenty_inverse<double> vi2(lon_s1 * bg::math::d2r, lon_s1 *
bg::math::d2r,
the second lon should be lat. Makes no difference for this test because
both are 51, but for other tests it should be changed.

you skip collinear cases?

> Here is the code and the results:
> https://github.com/awulkiew/test-geoside

Can you give a coordinate-pair where the deviation is large (probably
easy to read from the graph)?

Regards,
Barend


Geometry list run by mateusz at loskot.net