Create clients using the adjacencies
The client creation in OZmap, concerning the drop cable path, can be done in two ways:
With the drop cable connected in a straight line between the client’s location on the map and their connection box.
With the drop cable connected to the nearest pole to the client’s location and following adjacencies drawn in OZmap until it reaches the client’s connection box.
To create a client with their drop cable following adjacencies in OZmap, the ID of the nearest pole to the client must be provided in the creation request, indicating where the drop will follow towards the connection box.
Example
Considering that at this point we already have the data for the ID of the connection box (found through Feasibility from a pole), the ID of the splitter, and the client’s location in OZmap, we will use the following data in the example:
OZmap Box ID: 5ec9238c25a62d000cbf522e
OZmap Splitter ID: 5f6357e77a22524521000088
Customer's Location: -23.079191373253877, -52.461330145597465
From this, we’ll follow this step-by-step process:
Search for the nearest pole
Using “lat” and “lng” to inform the client location, the OZmap consultation would be made as follows:
curl --location -g --request \
GET 'https://sandbox.ozmap.com.br:9994/api/v2/poles?select=name&limit=1&filter=[{"property":"coords","value":{"lat":"-23.079191373253877","lng":"-52.461330145597465","radius":100},"operator":"near"}]' \
--header 'authorization: AUTHORIZATION_TOKEN'
P.S.: The “radius” parameter refers to the distance, in meters, of the search radius from the informed location.
The expected return would be:
{
"total": 12,
"count": 1,
"rows": [
{
"kind": "Pole",
"name": "P_2520",
"id": "63c93b0c6d0c980014f5834e",
"lng": null,
"lat": null
}
],
"start": 0,
"limit": 1
}
Check if there’s an adjacency path between the found pole and the box
IMPORTANT: If a request to create a client is sent with the pole ID, but there is no path from this pole to the box, the client will be created without a drop (and consequently, without a connection to the splitter).
The first step is to search for the pole to which the client’s connection box is linked. To do this, bypassing the client’s box ID, the query in OZmap would be performed as follows:
curl --location -g --request \
GET 'https://sandbox.ozmap.com.br:9994/api/v2/boxes/5ec9238c25a62d000cbf522e?&select=pole name' \
--header 'authorization: AUTHORIZATION_TOKEN'
The expected return is:
Knowing the nearest pole ID and the ID of the pole where the client’s box is, we can consult and determine if there's an adjacency path between those two points, using the client pole ID as “from” and the box pole ID as “to”:
The expected return is:
If there’s no path between the two points, the expected return is:
Send the request to create the customer, providing their nearest pole.
The data of a pole ID determines that the client should have their drop created using adjacencies.
To do this, by passing the ID of the nearest pole to the client as “pole,” the request to create the client in OZmap would be made as follows: