SqlServer-geography && Spatial result

说起geography(地理)这个类型,我感觉好陌生,以前真的没有见过,今天在查询某个Address表的时候,却发现了新大陆——Spatial result(空间的结果)。

(1)表的结构

(2)查询显示的结果

(3)Spatial result

(4)为了验证我的猜想,我把地图调用出来了。搜索了bothell这个地方。

大致区域吻合了。

为了具体了解这个类型,我进官网查看了一下。

Spatial Data (SQL Server)

大致的意思如下:

空间数据表示关于几何对象的物理位置和形状的信息。这些对象可以是点位置或更复杂的对象,如国家,道路,或湖泊。

SQL Server的支持两种空间数据类型:几何数据类型(geometry)和地理数据类型(geography)。

几何类型数据表示在欧几里得(平面)坐标系。

地理类型代表在一个圆形地球数据的坐标系。

这两种数据类型实现为SQL Server的.NET公共语言运行时(CLR)数据类型。

英文如下:

Spatial data represents information about the physical location and shape of geometric objects. These objects can be point locations or more complex objects such as countries, roads, or lakes.

SQL Server supports two spatial data types: the geometry data type and the geography data type.

The geometry type represents data in a Euclidean (flat) coordinate system.

The geography type represents data in a round-earth coordinate system.

Both data types are implemented as .NET common language runtime (CLR) data types in SQL Server.

官网链接如下:

https://msdn.microsoft.com/en-us/library/bb933790%28v=sql.110%29.aspx

原文地址:https://www.cnblogs.com/zi-xing/p/4357850.html