Double or decimal for latitude/longitude values in C#

前端 未结 4 1559
臣服心动
臣服心动 2020-12-24 04:02

What is the best data type to use when storing geopositional data in C#? I would use decimal for it\'s exactness, but operations on decimal floating point numbers are slower

4条回答
  •  甜味超标
    2020-12-24 05:06

    Double

    Combining the answers it is how Microsoft represents it itself in SqlGeography library

    [get: Microsoft.SqlServer.Server.SqlMethod(IsDeterministic=true, IsPrecise=true)] public System.Data.SqlTypes.SqlDouble Lat { get; } Property Value SqlDouble A SqlDouble value that specifies the latitude.

提交回复
热议问题