proper/best type for storing latitude and longitude

前端 未结 13 843
天涯浪人
天涯浪人 2020-12-07 11:21

In a system level programming language like C, C++ or D, what is the best type/encoding for storing latitude and longitude?

The options I see are:

  • IEEE
13条回答
  •  暖寄归人
    2020-12-07 11:40

    A Decimal representation with precision of 8 should be more than enough according to this wikipedia article on Decimal Degrees.

    0 decimal places, 1.0 = 111 km
    ...
    7 decimal places, 0.0000001 = 1.11 cm
    8 decimal places, 0.00000001 = 1.11 mm
    

提交回复
热议问题