2015-04-03 50 views
0

我已經使用Bing SDS創建併發布了一個數據源,但它是一個奇點,想知道如何創建一個定義區域的數據源?Bing SDS Geofence Schema

本質上我需要圍繞某個點的地理圍欄。下面是我的模式目前的樣子,我需要添加什麼參數來定義一個區域?

<?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> 

要通過我的意思是圍繞一個位置或包含位置多邊形一定半徑的區域清晰。 謝謝!

回答

0

您可以創建一個類型爲「Edm.Geography」或「xs:anyType」的列。該屬性類型採用Well Known Text,這是將空間形狀表示爲文本的標準方式。這允許您存儲常用的空間形狀,例如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與跟蹤設備地理圍欄博客文章:http://blogs.msdn.com/b/bingdevcenter/archive/2014/04/03/geo-fencing-with-bing-spatial-data-services-and-azure-mobile-services.aspx