warpscriptwarp10

GTS format / Warpscript : Best practices to provide LAT and LON values?


Some questions regarding the GTS format described here :

TS/LAT:LON/ELEV NAME{LABELS} VALUE

Thanks for your help


Solution

  • Internally, locations in Warp 10 are stored as HHCodes in a Long (64 bits). So latitude and longitude are each stored on 32 bits. This means HHcodes in Warp 10 have a maximum error of:

    To answer your question, 8 decimal digits should be the maximum. As far as I know, there is no real advantage of further reducing the number of decimal digits: it will very slightly reduce the needed bandwidth and the time to parse the data but at the cost of precision.

    I'm not aware of any function to restrict the precision of a Double, so you have to do that yourself:

    48.441583584062755 10 6 ** * ROUND 10.0 6 ** /
    

    If you use that often, consider creating a macro:

    <%
      'precision' STORE
      10 $precision ** * ROUND 10.0 $precision ** /
    %>
    'reduce_precision' STORE
    
    48.441583584062755 6 @reduce_precision