Bing SDS Geofence Schema

时间:2015-04-03 04:30:15

标签: geolocation geocoding geospatial bing-maps geofencing

我已经使用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>

要区域清楚,我指的是位置周围的某个半径或包含该位置的多边形。 谢谢!

1 个答案:

答案 0 :(得分:0)

您可以创建一个类型为&#34; Edm.Geography&#34;的列。或&#34; xs:anyType&#34;。此属性类型采用标准文本,这是将空间形状表示为文本的标准方法。这允许您存储常见的空间形状,如Point,LineString,Polygon,Multipoint,MultiLineString,MultiPolygon,GeometryCollection。以下是有关此文档的文档:

https://msdn.microsoft.com/en-us/library/gg585138.aspx

https://msdn.microsoft.com/en-us/library/dn436149.aspx

要表示地理栅栏,您需要创建一个表示所需区域的多边形。如果要表示圆形,则需要计算与圆近似的点:http://pietschsoft.com/post/2008/02/09/Virtual-Earth-Draw-a-Circle-Radius-Around-a-LatLong-Point

以下是关于使用存储在SDS中的Geofences与跟踪设备的博文:http://blogs.msdn.com/b/bingdevcenter/archive/2014/04/03/geo-fencing-with-bing-spatial-data-services-and-azure-mobile-services.aspx