Check if the asset's position is inside the geofences

User story

The user wants to check in which geofence polygons an asset resides, and how far away it is from the polygons.

Request

The code below shows an actual request matching the user story. The proximity query parameter represents the asset's GPS position latitude and longitude in WGS 84 degree.

https://geofencing.hereapi.com/v8/geofence
?layer_ids=4711
&apiKey=\{YOUR\_API\_KEY\}
&proximity=50.0,8.0,500
&key_attribute=POSTCODE

Note: This example uses a HERE API Key to authenticate your request. For the available authentication options, see the Identity & Access Management Developer Guide.

Response

The response to the request contains information about each geometry that either comprises the asset position or is not more than the given search radius away from the asset position:

{
    "warnings":[],
    "requestId":"469b08f3-2838-49d3-912d-4adf81d6e93c",
    "geometries":[
        {
            "distance":655.66,
            "nearestLat":50.0,
            "nearestLon":8.0,
            "attributes":
                {
                    "POSTCODE":"2009",
                    "ADMIN4":"Sydney",
                    ...
                }
        },
        {
            "distance":-99999999,
            "nearestLat":50.1,
            "nearestLon":8.1,
            "attributes":
                {
                    "POSTCODE":"2000",
                    "ADMIN4":"Sydney",
                    ...
                }
        }
    ],
}

results matching ""

    No results matching ""