本文翻译自:What datatype to use when storing latitude and longitude data in SQL databases? [duplicate]

This question already has an answer here: 这个问题在这里已有答案:

  • What is the ideal data type to use when storing latitude / longitude in a MySQL database? 在MySQL数据库中存储纬度/经度时使用的理想数据类型是什么? 20 answers 20个答案

When storing latitude or longitude data in an ANSI SQL compliant database, what datatype would be most appropriate? 在ANSI SQL兼容数据库中存储纬度或经度数据时,哪种数据类型最合适? Should float be used, or decimal , or ...? 应该使用float ,还是decimal ,还是......?

I'm aware that Oracle, MySql, and SQL Server have added some special datatypes specifically for handling geo data, but I'm interested in how you would store the information in a "plain vanilla" SQL database. 我知道Oracle,MySql和SQL Server已经添加了一些专门用于处理地理数据的特殊数据类型,但我对如何将信息存储在“普通的”SQL数据库中感兴趣。


#1楼

参考:https://stackoom.com/question/51f1/在SQL数据库中存储纬度和经度数据时要使用的数据类型是什么-重复


#2楼

Decimal(9,6)

如果你不习惯精度和比例参数,这里有一个格式字符串visual:

###.######


#3楼

我们使用float,但任何带有6位小数的数字风格也应该有效。


#4楼

我会使用具有适当精度的十进制数据。


#5楼

I think it depends on the operations you'll be needing to do most frequently. 我认为这取决于您最需要做的操作。

If you need the full value as a decimal number, then use decimal with appropriate precision and scale. 如果您需要十进制数的完整值,则使用具有适当精度和比例的十进制。 Float is way beyond your needs, I believe. 我相信Float超出了你的需求。

If you'll be converting to/from degºmin'sec"fraction notation often, I'd consider storing each value as an integer type (smallint, tinyint, tinyint, smallint?). 如果你经常转换为/来自degºmin'sec“分数表示法,我会考虑将每个值存储为整数类型(smallint,tinyint,tinyint,smallint?)。


#6楼

Well, you asked how to store Latitude/Longitude and my answer is: Don't, you might consider using the WGS 84 ( in Europe ETRS 89 ) as it is the standard for Geo references. 好吧,你问过如何存储纬度/经度,我的答案是:不要,你可以考虑使用WGS 84 (欧洲ETRS 89 ),因为它是地理参考的标准。

But that detail aside I used a User Defined Type in the days before SQL 2008 finally include geo support. 但除了那个细节,我在SQL 2008之前的几天使用了用户定义类型,最后包括地理支持。

在SQL数据库中存储纬度和经度数据时要使用的数据类型是什么? [重复]相关推荐

  1. mysql经度纬度类型_在MySQL数据库中存储纬度/经度时使用的理想数据类型是什么?...

    Gajus.. 41 取决于您需要的精度. Datatype Bytes resolution ------------------ ----- --------------------------- ...

  2. 数据库中存储日期的字段类型究竟应该用varchar还是datetime ?

    背景: 前段时间在百度经验看到一篇文章<如何在电脑右下角显示你(爱人)的名字>,之前也听过这个小技巧,但没真正动手设置过.所以出于好奇就实践了一下. 设置完成后的效果例如以下.右下角的时间 ...

  3. SQL数据库中临时表、临时变量和WITH AS关键词创建“临时表”的区别

    原文链接:https://www.cnblogs.com/zhaowei303/articles/4204805.html SQL数据库中数据处理时,有时候需要建立临时表,将查询后的结果集放到临时表中 ...

  4. Android学习笔记——保存数据到SQL数据库中(Saving Data in SQL Databases)

    知识点: 1.使用SQL Helper创建数据库 2.数据的增删查改(PRDU:Put.Read.Delete.Update) 背景知识: 上篇文章学习了保存文件,今天学习的是保存数据到SQL数据库中 ...

  5. azure云数据库_在Azure SQL数据库中保护数据的五种方法

    azure云数据库 When storing data in the cloud the main concern companies generally have is whether or not ...

  6. azure云数据库_在Azure SQL数据库中配置电子邮件通知

    azure云数据库 In this article, we will review how to configure email notifications in the Azure SQL sing ...

  7. azure云数据库_在Azure SQL数据库中实现动态数据屏蔽

    azure云数据库 In this article, we will review Dynamic Data Masking in the Azure SQL database. Dynamic Da ...

  8. azure云数据库_Azure SQL数据库中的高级数据安全性–数据发现和分类

    azure云数据库 Azure SQL supports in building and managing wide range of SQL databases, tools, frameworks ...

  9. azure云数据库_Azure SQL数据库中的漏洞评估和高级威胁防护

    azure云数据库 In today's time where data breaches are highly expected to happen, there is a high need to ...

最新文章

  1. Hibernate QBC 分页
  2. ipython怎么安装_安装ipython最简单的方法
  3. 【lucene系列学习二】Lucene实现高亮显示关键词
  4. Android数据库Realm实践
  5. 生成指定序列的前一字典序序列(洛谷P2525题题解,C++语言描述)
  6. Flex 3 metadata tags 标签
  7. Markdown编辑LaTeX数学公式
  8. PLAY2.6-SCALA(五) Action的组合、范围的设置以及错误的处理
  9. 特殊的栈GetMin
  10. 2008年IT日历 02
  11. 高清3D人体解剖图谱
  12. 基于51单片机的多功能温度监测系统(附代码)
  13. android 测光模式,安卓手机里的专业模式究竟该怎么拍?
  14. 关于自己学习安卓的体会
  15. 金弘同创怎么样:拼多多获取奖励金的办法
  16. 鸿蒙归蝶的反弹,副本攻略-鸿蒙试炼
  17. Git之深入解析如何借助Git的配置方法和钩子机制来自定义Git需求
  18. VS Code 也能预览 Markdown - 一个无意中发现的小技巧
  19. 基于OSM的地图大数据应用开发-1
  20. ArcGIS批量修改CASS标注 | 小技巧,高效率

热门文章

  1. Efficient Estimation of Word Representations in Vector Space 笔记
  2. android 分屏投影,Android 双屏异显实现的三种方式
  3. 九州云Edge MEP作为典型产品入选《中国边缘云研究》报告
  4. html5 video 手机上播放和下载的问题
  5. Android高德地图路线规划,自定义图层(overlay),所有点和线刚好显示在屏幕中心
  6. 嵌入式实习ing(一)
  7. 澄海哪里学机器人编程_终于发现小孩有必要学机器人编程吗
  8. 中级口译口试该如何准备?
  9. 论文阅读 Day-1: GSLAM: A General SLAM Framework and Benchmark
  10. 测试人员具备的技术要求