proper/best type for storing latitude and longitude

前端 未结 13 842
天涯浪人
天涯浪人 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:38

    You can use decimal datatype:

    CREATE TABLE IF NOT EXISTS `map` (
      `latitude` decimal(18,15) DEFAULT NULL,
      `longitude` decimal(18,15) DEFAULT NULL 
    );
    

提交回复
热议问题