本文介绍了在 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.

更多信息:

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

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

08-30 02:20