logo separator

[mkgmap-dev] Incorrect compilation of grid lines

From Gerd Petermann gpetermann_muenchen at hotmail.com on Fri Jul 25 10:15:52 BST 2014

Hi Felix,

I agree. I am working on a simple patch that tries to detect that the formula doesn't work. 
I just have to decide what to do in that case, typically it is better to keep the point, so 
img size might increase.

Gerd

Date: Fri, 25 Jul 2014 11:12:40 +0200
From: extremecarver at gmail.com
To: mkgmap-dev at lists.mkgmap.org.uk
Subject: Re: [mkgmap-dev] Incorrect compilation of grid lines


  
    
  
  
    not an idea - but a comment. I think that for such a special
    nonusual case, there should be no degradation for the general use.
    Wouldn't it be enough to just switch off douglas peucker algo for
    maps where you want to include long "straigt" lines?

    On 25.07.2014 10:46, Gerd Petermann
      wrote:

    
    
      
      Hi Roger,

        

        the problem is caused by the routine that removes obsolete
        points from straigt lines. 

        This routine doesn't care (enough) about the spherical
        distortian.

        The routine uses herons formula to "calculate distance of point
        in the middle to line c1,c2".

        This formula is for 2D, but used to work good enough with the
        rather short ways 

        we have in OSM. (The formula is also used in the Douglas-Peucker
        filter).

        With long lines the as in your data, the errors are too big and
        the routine returns garbage.

        

        If I got that right, we have to use the formula for the
        "Cross-track distance" as described here:

        http://www.movable-type.co.uk/scripts/latlong.html

          

        Unfortunately, this routine uses more trigonometrical
        calculations, so it will be slower.

        

        @Programmers: Any other ideas?

        

        Gerd

        

        
          Date: Wed, 25 Jun 2014 12:12:18 +0100

          From: roger at rogercalvert.me.uk

          To: mkgmap-dev at lists.mkgmap.org.uk

          Subject: [mkgmap-dev] Incorrect compilation of grid lines

          

          I have a file containing the British National Grid lines, as
          printed on Ordnance Survey maps. This can be found at http://www.rogercalvert.me.uk/osm/GBGrid/GBGrid.zip
          (this contains two files, they are the same except for the
          addition of the 'version' tag in the GBGrid06.osm file). I
          compile this file with mkgmap and overlay it on my GPS map.

          

          This works correctly with mkgmap 2654 and It displays
          correctly in JOSM.

          

          With mkgmap version 3241, the lines are misaligned and out of
          position. The behaviour is the same on MapSource, BaseCamp and
          my device. No error messages are produced.

          

          (I have not used any versions of mkgmap in between these two).
          

          

          My style file allocates codes in the 0x10300 range to these
          lines, but the effect is the same when I use code 0x21
          (contour) for all lines.

          

          Attached are screen dumps for a small part of the map, from
          JOSM, mkgmap 2654 and mkgmap 3241, and also the batch file I
          used to compile it.

          

          I would greatly appreciate any advice.

          

          Many thanks,

          

          Roger

          -- 

            

            Roger Calvert

            http://www.rogercalvert.me.uk

            
          

          _______________________________________________
          mkgmap-dev mailing list
          mkgmap-dev at lists.mkgmap.org.uk
          http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
      
      

      
      

      _______________________________________________
mkgmap-dev mailing list
mkgmap-dev at lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
    
    

    -- 
keep on biking and discovering new trails

Felix
openmtbmap.org & www.velomap.org
  


_______________________________________________
mkgmap-dev mailing list
mkgmap-dev at lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20140725/e809932d/attachment.html>


More information about the mkgmap-dev mailing list