What#39;s the best way to store co-ordinates (longitude/latitude, from Google Maps) in SQL Server?(在 SQL Server 中存储坐标(经度/纬度,来自谷歌地图)的最佳方式是什么?)
问题描述
我正在 SQL Server 2008 中设计一个表,用于存储用户列表和 Google 地图坐标(经度和纬度).
I'm designing a table in SQL Server 2008 that will store a list of users and a Google Maps co-ordinate (longitude & latitude).
我需要两个字段,还是可以用 1 个来完成?
Will I need two fields, or can it be done with 1?
用于存储此类数据的最佳(或最常见)数据类型是什么?
What's the best (or most common) data-type to use for storing this kind of data?
推荐答案
看看 SQL Server 2008 中引入的新空间数据类型.它们专为此类任务而设计,使索引和查询变得更加容易并且更高效.
Take a look at the new Spatial data-types that were introduced in SQL Server 2008. They are designed for this kind of task and make indexing and querying much easier and more efficient.
更多信息:
MS TechNet:SQL Server 2008 空间数据类型、
MSDN:使用空间数据(数据库引擎).
这篇关于在 SQL Server 中存储坐标(经度/纬度,来自谷歌地图)的最佳方式是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 SQL Server 中存储坐标(经度/纬度,来自谷歌地图)的最佳方式是什么?


基础教程推荐
- 带有WHERE子句的LAG()函数 2022-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- 带更新的 sqlite CTE 2022-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01