在SQL Server中存储坐标(经度/纬度,来自Google Maps)的最佳方法是什么? [英] What's the best way to store co-ordinates (longitude/latitude, from Google Maps) in SQL Server?

查看:170
本文介绍了在SQL Server中存储坐标(经度/纬度,来自Google Maps)的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在SQL Server 2008中设计一个表,该表将存储用户列表和Google Maps坐标(经度和纬度).

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中引入的新Spatial数据类型.它们是为此类任务而设计的,使索引和查询变得更加容易并且更有效率.

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.

更多信息:

MSDN:使用空间数据(数据库引擎).

这篇关于在SQL Server中存储坐标(经度/纬度,来自Google Maps)的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆