I am trying to use the following query to search if a point is within a defined POLYGON (aka a geofence I want to define):

https://spatial.virtualearth.net/REST/v1/data/[DataSourceID]/[DataSourceName]/[EntityName]?SpatialFilter=intersects('POINT(9.874434 57.003766)')&$format=json&key=[BingMapsKey]

My Data Source Schema looks like this:

   <AddressLine>1 Microsoft Way</AddressLine>
   <CountryRegion>United States</CountryRegion>
   <Manager>Alan Steiner</Manager>
   <GeoFence>POLYGON((9.86445 57.13876,9.89266 57.13876, 9.89266 56.94234,9.86445, 56.94234,9.86445 57.13876))</Fence>

Essentially what I am trying to do is pass in Latitude and Longitude values to the POINT parameter in my query, and check if that location is within my GeoFence entity(defined POLYGON) or not. Please help me with creating a correct Data Source schema to run this kind of query.

I am using Bing SDS to hold all of this information. I was trying to follow this tutorial http://blogs.msdn.com/b/bingdevcenter/archive/2014/04/03/geo-fencing-with-bing-spatial-data-services-and-azure-mobile-services.aspx But cannot get my DataSource schema and query quite right.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.