我用Bing SDS创建并发布了一个数据源,但它是一个奇点,我想知道如何创建一个定义区域的数据源?
从本质上讲,我需要一个围绕某个点的地理围栏。下面是我的模式当前的样子,我需要添加哪些参数来定义一个区域?
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<MainRoot>
<xs:schema id="FourthCoffeeShops_ds" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="FourthCoffeeShops_ds" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="FourthCoffeeShops">
<xs:complexType>
<xs:sequence>
<xs:element name="EntityID" type="xs:string" />
<xs:element name="AddressLine" type="xs:string" minOccurs="0" />
<xs:element name="Locality" type="xs:string" minOccurs="0" />
<xs:element name="AdminDistrict" type="xs:string" minOccurs="0" />
<xs:element name="PostalCode" type="xs:string" minOccurs="0" />
<xs:element name="CountryRegion" type="xs:string" minOccurs="0" />
<xs:element name="Phone" type="xs:string" minOccurs="0" />
<xs:element name="Manager" type="xs:string" minOccurs="0" />
<xs:element name="Latitude" type="xs:double" minOccurs="0" />
<xs:element name="Longitude" type="xs:double" minOccurs="0" />
<xs:element name="Confidence" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:unique name="Constraint1" msdata:PrimaryKey="true">
<xs:selector xpath=".//FourthCoffeeShops" />
<xs:field xpath="EntityID" />
</xs:unique>
</xs:element>
</xs:schema>
<FourthCoffeeShops>
<EntityID>1000</EntityID>
<AddressLine>1 Microsoft Way</AddressLine>
<Locality>Redmond</Locality>
<AdminDistrict>WA</AdminDistrict>
<PostalCode>98052</PostalCode>
<Phone>303-555-0188</Phone>
<Manager>Alan Steiner</Manager>
<Latitude>47.640049</Latitude>
<Longitude>-122.129797</Longitude>
<Confidence>High</Confidence>
</FourthCoffeeShops>
<FourthCoffeeShops>
<EntityID>1001</EntityID>
<AddressLine>1 Microsoft Way</AddressLine>
<Locality>Redmond</Locality>
<AdminDistrict>WA</AdminDistrict>
<PostalCode>98052</PostalCode>
<CountryRegion>United States</CountryRegion>
<Phone>425-555-0111</Phone>
<Manager>Phil Spencer</Manager>
<Latitude>47.639767</Latitude>
<Longitude>-122.129959</Longitude>
<Confidence>Medium</Confidence>
</FourthCoffeeShops>
</MainRoot>明确地说,我所说的面积是指一个位置或包含该位置的多边形周围的某个半径。谢谢!
发布于 2015-04-04 02:51:47
您可以创建类型为"Edm.Geography“或"xs:anyType”的列。此属性类型接受熟知的文本,这是将空间形状表示为文本的标准方式。这允许您存储常见的空间形状,如点、LineString、多边形、多点、MultiLineString、MultiPolygon、GeometryCollection。以下是与此相关的文档:
https://msdn.microsoft.com/en-us/library/gg585138.aspx
https://msdn.microsoft.com/en-us/library/dn436149.aspx
要表示GeoFence,您需要创建一个表示所需区域的多边形。如果要表示圆,则需要计算近似于该圆的点:http://pietschsoft.com/post/2008/02/09/Virtual-Earth-Draw-a-Circle-Radius-Around-a-LatLong-Point
这是一篇关于将存储在SDS中的Geofence与受跟踪设备一起使用的博客文章:http://blogs.msdn.com/b/bingdevcenter/archive/2014/04/03/geo-fencing-with-bing-spatial-data-services-and-azure-mobile-services.aspx
https://stackoverflow.com/questions/29426217
复制相似问题