[Patch v1] detect cases where Herons formula is failing in 3D

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Patch v1] detect cases where Herons formula is failing in 3D

Gerd Petermann
Hi all,

attached is a patch that addresses the problem described be Roger Calvert:
http://gis.19327.n5.nabble.com/Incorrect-compilation-of-grid-lines-tp5809502.html

The problem is caused by the fact that we use a 2D formula for objects which are on
a spherical surface. In most cases the error is very small and can be ignored, but
sometimes it isn't. We use the formula to decide whether a point is important or
not, so I decided that to keep all points where the error is big.
A better way would be to use a correct formula in that cases, but I am not clever
enough to code the correct formula  in Java :-(

@Roger: Please check if the results are ok for you.
BTW: osmconvert seems to have a problem with some coordinates, e.g.
<node id='90053000500' lat='54.3788936' lon='1.67E-05' version='1'/>
is interpreted as
<node id="90053000500" lat="54.3788936" lon="1.67" version="1"/>
Don't know if the OSM api allows the exponent format?

A compiled patched binary for mkgmap can be found here:
http://files.mkgmap.org.uk/download/217/mkgmap.jar

Gerd


_______________________________________________
mkgmap-dev mailing list
[hidden email]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

heron_error_v1.patch (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Patch v1] detect cases where Herons formula is failing in 3D

Roger Calvert
Gerd,

This patched binary for 3316 seems to have solved the problem - thank you very much!

As regards the exponent format, I did not know it was there - must be something to do with the rounding to 7 figures. There are 9 occurrences - all 'E-05'. I will modify the file generator to get rid of them.

Thanks again,

Roger

On 26/07/2014 11:15, Gerd Petermann wrote:
Hi all,

attached is a patch that addresses the problem described be Roger Calvert:
http://gis.19327.n5.nabble.com/Incorrect-compilation-of-grid-lines-tp5809502.html

The problem is caused by the fact that we use a 2D formula for objects which are on
a spherical surface. In most cases the error is very small and can be ignored, but
sometimes it isn't. We use the formula to decide whether a point is important or
not, so I decided that to keep all points where the error is big.
A better way would be to use a correct formula in that cases, but I am not clever
enough to code the correct formula  in Java :-(

@Roger: Please check if the results are ok for you.
BTW: osmconvert seems to have a problem with some coordinates, e.g.
<node id='90053000500' lat='54.3788936' lon='1.67E-05' version='1'/>
is interpreted as
<node id="90053000500" lat="54.3788936" lon="1.67" version="1"/>
Don't know if the OSM api allows the exponent format?

A compiled patched binary for mkgmap can be found here:
http://files.mkgmap.org.uk/download/217/mkgmap.jar

Gerd



_______________________________________________
mkgmap-dev mailing list
[hidden email]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


_______________________________________________
mkgmap-dev mailing list
[hidden email]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev