|
| 1 | +Estimated Location |
| 2 | +================== |
| 3 | + |
| 4 | +.. important:: |
| 5 | + |
| 6 | + The **Estimated Location** feature is **disabled by default**. |
| 7 | + |
| 8 | + Before enabling it, the :doc:`WHOIS Lookup feature <whois>` must be |
| 9 | + enabled. Then set |
| 10 | + :ref:`OPENWISP_CONTROLLER_ESTIMATED_LOCATION_ENABLED` to ``True`` |
| 11 | + |
| 12 | +.. contents:: **Table of contents**: |
| 13 | + :depth: 1 |
| 14 | + :local: |
| 15 | + |
| 16 | +Overview |
| 17 | +-------- |
| 18 | + |
| 19 | +The Estimated Location feature automatically creates or updates a device’s |
| 20 | +location based on latitude and longitude information retrieved from the |
| 21 | +WHOIS Lookup feature. |
| 22 | + |
| 23 | +Trigger Conditions |
| 24 | +------------------ |
| 25 | + |
| 26 | +Estimated Location is triggered when: |
| 27 | + |
| 28 | +- A **fresh WHOIS lookup** is performed for a device. |
| 29 | +- Or when a WHOIS record already exists for the device’s IP **and**: |
| 30 | + |
| 31 | + - The device’s last IP address is **public**. |
| 32 | + - WHOIS lookup and Estimated Location is **enabled** for the device’s |
| 33 | + organization. |
| 34 | + |
| 35 | +Behavior |
| 36 | +-------- |
| 37 | + |
| 38 | +The system will **attach the already existing matching location** of |
| 39 | +another device with same ip to the current device if: |
| 40 | + |
| 41 | +- Only one device is found with that IP and it has a location. |
| 42 | +- The current device **has no location** or that location is |
| 43 | + **estimated**. |
| 44 | + |
| 45 | +If there are multiple devices with location for the same IP, the system |
| 46 | +will **not attach any location** to the current device and a notification |
| 47 | +will be sent suggesting the user to manually assign/create a location for |
| 48 | +the device. |
| 49 | + |
| 50 | +If there is **no matching location**, a new estimated location is created |
| 51 | +or the existing one is updated using coordinates from the WHOIS record, |
| 52 | +but only if the existing location is estimated. |
| 53 | + |
| 54 | +If two devices share the same IP address and are assigned to the same |
| 55 | +location, and the last IP of one of the devices is updated, the system |
| 56 | +will create a new estimated location for that device. |
| 57 | + |
| 58 | +Visibility of Estimated Status |
| 59 | +------------------------------ |
| 60 | + |
| 61 | +The estimated status of a location is visible on the location page if the |
| 62 | +feature is enabled for the organization. The location admin page also |
| 63 | +includes indicators for the estimated status. |
| 64 | + |
| 65 | +- The name of the location will have suffix **(Estimated Location : |
| 66 | + <ip_address>)**. |
| 67 | +- A warning on top of the page. |
| 68 | +- **Is Estimated** field. |
| 69 | + |
| 70 | +Changes to the ``coordinates`` and ``geometry`` of the estimated location |
| 71 | +will set the ``is_estimated`` field to ``False`` and remove the |
| 72 | +"(Estimated Location)" suffix with IP from the location name. |
| 73 | + |
| 74 | +In REST API, the field will be visible in the :ref:`Device Location |
| 75 | +<device_location_estimated>`, :ref:`Location list |
| 76 | +<location_list_estimated>`, :ref:`Location Detail |
| 77 | +<location_detail_estimated>` and :ref:`Location list (GeoJson) |
| 78 | +<location_geojson_estimated>` if the feature is **enabled**. The field can |
| 79 | +also be used for filtering in the location list (including geojson) |
| 80 | +endpoints and in the :ref:`Device List <device_list_estimated_filters>`. |
0 commit comments