Spatial

Operations

Get Buffer

Applies to: S1 pricing tier.

This API returns a FeatureCollection where each Feature is a buffer around the corresponding indexed Feature of the input. The buffer could be either on the outside or the inside of the provided Feature, depending on the distance provided in the input. There must be either one distance provided per Feature in the FeatureCollection input, or if only one distance is provided, then that distance is applied to every Feature in the collection. The positive (or negative) buffer of a geometry is defined as the Minkowski sum (or difference) of the geometry with a circle of radius equal to the absolute value of the buffer distance. The buffer API always returns a polygonal result. The negative or zero-distance buffer of lines and points is always an empty polygon. The input features are provided by a GeoJSON file which is uploaded via Data Upload API and referenced by a unique udid. The GeoJSON file may contain a collection of Point, MultiPoint, Polygon, MultiPolygon, LineString and MultiLineString. GeometryCollection will be ignored if provided.

To test this API, you can upload the sample data from Post Buffer API examples(Request Body without distances array) via Data Upload API and replace the [udid] from the sample request below with the udid returned by Data Upload API.

Get Closest Point

Applies to: S1 pricing tier.

This API returns the closest point between a base point and a given set of points in the user uploaded data set identified by udid. The set of target points is provided by a GeoJSON file which is uploaded via Data Upload API and referenced by a unique udid. The GeoJSON file may only contain a collection of Point geometry. MultiPoint or other geometries will be ignored if provided. The maximum number of points accepted is 100,000. The algorithm does not take into account routing or traffic. Information returned includes closest point latitude, longitude, and distance in meters from the closest point.

To test this API, you can upload the sample data from Post Closest Point API examples(Request Body) via Data Upload API and replace the [udid] from the sample request below with the udid returned by Data Upload API.

Get Geofence

Search Geofence Get API

Applies to: S1 Pricing tier.

The Geofence Get API allows you to retrieve the proximity of a coordinate to a geofence that has been uploaded to the Data service. You can use the Data Upload API to upload a geofence or set of fences. See Geofencing GeoJSON data for more details on the geofence data format. To query the proximity of a coordinate, you supply the location of the object you are tracking as well as the ID for the fence or set of fences, and the response will contain information about the distance from the outer edge of the geofence. A negative value signifies that the coordinate is inside of the fence while a positive value means that it is outside of the fence.

This API can be used for a variety of scenarios that include things like asset tracking, fleet management, or setting up alerts for moving objects.

The API supports integration with Event Grid. The isAsync parameter is used to enable integration with Event Grid (disabled by default). To test this API, you can upload the sample data from Post Geofence API examples(Request Body) via Data Upload API and replace the [udid] from the sample request below with the udid returned by Data Upload API.

Geofencing InnerError code

In geofencing response error contract, innererror is an object containing service specific information about the error. code is a property in innererror which can map to a specific geofencing error type. The table belows shows the code mapping between all the known client error type to the corresponding geofencing error message.

innererror.code error.message
NullDeviceId Device Id should not be null.
NullUdid Udid should not be null.
UdidWrongFormat Udid should be acquired from user data ingestion API.
InvalidUserTime Usertime is invalid.
InvalidSearchBuffer Searchbuffer is invalid.
InvalidSearchRange The value range of searchbuffer should be from 0 to 500 meters.
InvalidLatLon Lat and/or lon parameters are invalid.
InvalidIsAsyncValue The IsAsync parameter is invalid.
InvalidModeValue The mode parameter invalid.
InvalidJson Geofencing data is not a valid json file.
NotSupportedGeoJson Geofencing data can't be read as a Feature or FeatureCollections.
InvalidGeoJson Geofencing data is invalid.
NoUserDataWithAccountOrSubscription Can't find user geofencing data with provided account-id and/or subscription-id.
NoUserDataWithUdid Can't find user geofencing data with provided udId.
Get Great Circle Distance

Applies to: S1 pricing tier.

This API will return the great-circle or shortest distance between two points on the surface of a sphere, measured along the surface of the sphere. This differs from calculating a straight line through the sphere's interior. This method is helpful for estimating travel distances for airplanes by calculating the shortest distance between airports.

Get Point In Polygon

Applies to: S1 pricing tier.

This API returns a boolean value indicating whether a point is inside a set of polygons. The set of polygons is provided by a GeoJSON file which is uploaded via Data Upload API and referenced by a unique udid. The GeoJSON file may contain Polygon and MultiPolygon geometries, other geometries will be ignored if provided. If the point is inside or on the boundary of one of these polygons, the value returned is true. In all other cases, the value returned is false. When the point is inside multiple polygons, the result will give intersecting geometries section to show all valid geometries(referenced by geometryId) in user data. The maximum number of vertices accepted to form a Polygon is 10,000.

To test this API, you can upload the sample data from Post Point In Polygon API examples(Request Body) via Data Upload API and replace the [udid] from the sample request below with the udid returned by Data Upload API.

Post Buffer

Applies to: S1 pricing tier.

This API returns a FeatureCollection where each Feature is a buffer around the corresponding indexed Feature of the input. The buffer could be either on the outside or the inside of the provided Feature, depending on the distance provided in the input. There must be either one distance provided per Feature in the FeatureCollection input, or if only one distance is provided, then that distance is applied to every Feature in the collection. The positive (or negative) buffer of a geometry is defined as the Minkowski sum (or difference) of the geometry with a circle of radius equal to the absolute value of the buffer distance. The buffer API always returns a polygonal result. The negative or zero-distance buffer of lines and points is always an empty polygon. The input may contain a collection of Point, MultiPoint, Polygon, MultiPolygon, LineString and MultiLineString. GeometryCollection will be ignored if provided.

Post Closest Point

Applies to: S1 pricing tier.

This API returns the closest point between a base point and a given set of target points. The set of target points is provided by user data in post request body. The user data may only contain a collection of Point geometry. MultiPoint or other geometries will be ignored if provided. The algorithm does not take into account routing or traffic. The maximum number of points accepted is 100,000. Information returned includes closest point latitude, longitude, and distance in meters from the closest point.

Post Geofence

Search Geofence Post API

Applies to: S1 Pricing tier.

The Geofence Post API allows you to retrieve the proximity of a coordinate to a provided geofence or set of fences. With POST call, you do not have to upload the fence data in advance, instead you supply the location of the object you are tracking in query parameters as well as the fence or set of fences data in post request body. See Geofencing GeoJSON data for more details on the geofence data format. The response will contain information about the distance from the outer edge of the geofence. A negative value signifies that the coordinate is inside of the fence while a positive value means that it is outside of the fence.

This API can be used for a variety of scenarios that include things like asset tracking, fleet management, or setting up alerts for moving objects.

The API supports integration with Event Grid. The isAsync parameter is used to enable integration with Event Grid (disabled by default).

Post Point In Polygon

Applies to: S1 pricing tier.

This API returns a boolean value indicating whether a point is inside a set of polygons. The user data may contain Polygon and MultiPolygon geometries, other geometries will be ignored if provided. If the point is inside or on the boundary of one of these polygons, the value returned is true. In all other cases, the value returned is false. When the point is inside multiple polygons, the result will give intersecting geometries section to show all valid geometries (referenced by geometryId) in user data. The maximum number of vertices accepted to form a Polygon is 10,000.