# Geofencing LatLon
This service returns the variables with information defined by the zones created by the user, these can be: dangerous zones, delivery zones, coverage zones, etc. of the requested latitude, longitude location. Said location can come from a GPS type device of a cell phone, Laptop, PC, Home, etc. Or information stored in their data repositories.
Required parameters in a Geofencing request:
- latlon: the latitude and longitude values that specify the location for which you want to get the Geofencing information.
- key: the API key of your application. This key identifies your application for quota management purposes. Learn to get API key.
# Geofencing LatLon Example
The following base service request would have the following structure:
https://apis.geodir.co/geofencing/v1/json?latlon=-12.060421,-77.010781&key=YOUR_KEY
Note: Make sure that there is no space between the latitude and longitude values when passed in the latlon parameter.
{
"status": "OK",
"results": [
{
"alias": "Capa Zonas peligrosas",
"namecode": "CAPA_1",
"spatial_analysis": {
"name": "intersect",
"result": false
},
"fields": [
{
"name": "type",
"value": "peligrosa"
},
{
"name": "message",
"value": "DELINCUENCIAL"
}
]
},
{
"alias": "Capa Itinerante",
"namecode": "CAPA_2",
"spatial_analysis": {
"name": "intersect",
"result": false
},
"fields": [
{
"name": "type",
"value": "itinerante"
},
{
"name": "message",
"value": "PRUEBA"
}
]
}
]
}
# Geofencing LatLon Responses
Below are the possible status codes in a Geofencing response.
# Geofencing LatLon Status Codes
The "status" field within the Geofencing response object contains the status of the request and may contain debugging information to help you figure out why geocoding isn't working. The "status" field can contain the following values:
- "OK" indicates that the Geofencing service did not produce any errors; the service performed the action correctly.
- "ZERO_RESULTS" indicates that the Geofencing service was successful but returned no results. This can happen if the service passed a non-existent latlon or was out of zone.
- "OVER_QUERY_LIMIT" indicates that you have exceeded your quota.
- "REQUEST_DENIED" indicates that your request was denied.
- "INVALID_REQUEST" generally indicates one of the following:
- Missing query (address, groups or latlon).
- An invalid groups was provided.
- "UNKNOWN_ERROR" indicates that the request could not be processed due to a server error. The request may be successful if you try again.
The "alias" field describes the name of the dataset (set of information). For example: Criminal Zones, Delivery Zones, among others.
The "namecode" field refers to a unique encoding of the dataset (set of information).
The "spatial_analysis" field refers to the type of spatial analysis performed by the geofencing service. For example: intersect (Refers to a spatial intersection). <!-- ## Parámetros opcionales
Parámetros opcionales:
- Groups: Es un filtro con elementos separados por una tubería (|). El filtro de grupos también se acepta como parámetro opcional. Cada elemento consta de un par grupo lo cual es un valor y restringe completamente los resultados de geofencing. Consulte más información sobre el filtrado de grupos.
- info: es una serie de valores útiles al cliente para almacenar información complementaria o metadatos, estos elementos deben estar separados por una tubería (|).
# Filtrado de grupos
En una respuesta de Geofencing, la API de Geofencing puede devolver resultados restringidos a un área específica. Puede especificar la restricción utilizando el filtro de grupos. Un filtro consta de una lista de pares sgroup:value separados por una barra vertical (|). Los valores de filtro admiten los mismos métodos de corrección ortográfica y coincidencia parcial que otras solicitudes de Geofencing. -->