|
| 1 | +Estimated Location |
| 2 | +================== |
| 3 | + |
| 4 | +.. image:: https://raw.githubusercontent.com/openwisp/openwisp-controller/docs/docs/1.3/estimated-locations/is-estimated-flag.png |
| 5 | + :target: https://raw.githubusercontent.com/openwisp/openwisp-controller/docs/docs/1.3/estimated-locations/is-estimated-flag.png |
| 6 | + :alt: Estimated location flag |
| 7 | + |
| 8 | +.. important:: |
| 9 | + |
| 10 | + The **Estimated Location** feature is **disabled by default**. |
| 11 | + |
| 12 | + Before enabling it, the :ref:`WHOIS Lookup feature |
| 13 | + <controller_setup_whois_lookup>` must be enabled. |
| 14 | + |
| 15 | + Then set :ref:`OPENWISP_CONTROLLER_ESTIMATED_LOCATION_ENABLED` to |
| 16 | + ``True``. |
| 17 | + |
| 18 | +.. contents:: **Table of contents**: |
| 19 | + :depth: 1 |
| 20 | + :local: |
| 21 | + |
| 22 | +Overview |
| 23 | +-------- |
| 24 | + |
| 25 | +This feature automatically creates or updates a device's location based on |
| 26 | +latitude and longitude information retrieved from the :doc:`whois` |
| 27 | +feature. |
| 28 | + |
| 29 | +It is very useful for those users who have devices scattered across |
| 30 | +different geographic regions and would like some help to place the devices |
| 31 | +on the map, while being gently reminded to improve the precision of the |
| 32 | +location with a direct link for doing so. |
| 33 | + |
| 34 | +It also significantly reduces the effort required to assign a geographic |
| 35 | +location manually when many devices are deployed in large buildings like |
| 36 | +schools, offices, hospitals, libraries, etc. Improve the precision of the |
| 37 | +estimated location just once and all the other devices sharing the same |
| 38 | +public IP will automatically inherit the same location. |
| 39 | + |
| 40 | +The feature is not useful in the following scenarios: |
| 41 | + |
| 42 | +- Most devices are deployed in one single location. |
| 43 | +- Most devices are mobile (e.g. moving vehicles). |
| 44 | + |
| 45 | +Visibility of Estimated Status |
| 46 | +------------------------------ |
| 47 | + |
| 48 | +The estimated status of a location is visible in the admin interface in |
| 49 | +several ways: |
| 50 | + |
| 51 | +- The location name will mention the *IP address* from which it was |
| 52 | + estimated. |
| 53 | +- A *warning message* appears at the top of the location list page as in |
| 54 | + the image below. |
| 55 | + |
| 56 | + .. image:: https://raw.githubusercontent.com/openwisp/openwisp-controller/docs/docs/1.3/estimated-locations/estimated-warning.png |
| 57 | + :target: https://raw.githubusercontent.com/openwisp/openwisp-controller/docs/docs/1.3/estimated-locations/estimated-warning.png |
| 58 | + :alt: Estimated location warning |
| 59 | + |
| 60 | +- The *Is Estimated?* flag is displayed both in the location list page and |
| 61 | + in the location detail page, as in the images below. |
| 62 | + |
| 63 | + .. image:: https://raw.githubusercontent.com/openwisp/openwisp-controller/docs/docs/1.3/estimated-locations/admin-list.png |
| 64 | + :target: https://raw.githubusercontent.com/openwisp/openwisp-controller/docs/docs/1.3/estimated-locations/admin-list.png |
| 65 | + :alt: Estimated location admin list |
| 66 | + |
| 67 | + .. image:: https://raw.githubusercontent.com/openwisp/openwisp-controller/docs/docs/1.3/estimated-locations/is-estimated-flag.png |
| 68 | + :target: https://raw.githubusercontent.com/openwisp/openwisp-controller/docs/docs/1.3/estimated-locations/is-estimated-flag.png |
| 69 | + :alt: Estimated location flag |
| 70 | + |
| 71 | +- The device list page also allows filtering devices which are associated |
| 72 | + with estimated locations as shown in the image below. |
| 73 | + |
| 74 | + .. image:: https://raw.githubusercontent.com/openwisp/openwisp-controller/docs/docs/1.3/estimated-locations/filter-devices-by-estimated-location.png |
| 75 | + :target: https://raw.githubusercontent.com/openwisp/openwisp-controller/docs/docs/1.3/estimated-locations/filter-devices-by-estimated-location.png |
| 76 | + :alt: Filter devices associated to estimated locations |
| 77 | + |
| 78 | +Any change to the geographic coordinates of an estimated location will set |
| 79 | +the ``is_estimated`` field to ``False``. |
| 80 | + |
| 81 | +When manually increasing the precision of estimated locations, it is |
| 82 | +highly recommended to also change the auto-generated location name. |
| 83 | + |
| 84 | +In the REST API, the ``is_estimated`` field is visible in the :ref:`Device |
| 85 | +Location <device_location_estimated>`, :ref:`Location list |
| 86 | +<location_list_estimated>`, :ref:`Location Detail |
| 87 | +<location_detail_estimated>` and :ref:`Location list (GeoJSON) |
| 88 | +<location_geojson_estimated>` endpoints if the feature is enabled. The |
| 89 | +field can also be used for filtering in the location list endpoints, |
| 90 | +including the GeoJSON endpoint, and in the :ref:`Device List |
| 91 | +<device_list_estimated_filters>`. |
| 92 | + |
| 93 | +Triggers and Record Management |
| 94 | +------------------------------ |
| 95 | + |
| 96 | +The feature is triggered automatically when all the following conditions |
| 97 | +are met: |
| 98 | + |
| 99 | +- A WHOIS lookup is performed. |
| 100 | +- The last IP is a public IP address. |
| 101 | +- Both WHOIS lookup and Estimated Location features are enabled for the |
| 102 | + device's organization. |
| 103 | + |
| 104 | +If no matching location exists, a new estimated location is created using |
| 105 | +coordinates from the WHOIS record. If an estimated location already |
| 106 | +exists, it will be updated with the new coordinates. |
| 107 | + |
| 108 | +If another device with the same IP already has a location, the system will |
| 109 | +assign the same location for any device having the same IP and not being |
| 110 | +assigned to any other location. |
| 111 | + |
| 112 | +If two devices share the same IP and are assigned to the same location, |
| 113 | +and one of them updates its last IP, the system will create a new |
| 114 | +estimated location for that device. |
| 115 | + |
| 116 | +When multiple devices with the same IP already have a location assigned |
| 117 | +but the locations differ, the system will send a notification to network |
| 118 | +administrators asking to manually resolve the ambiguity. |
| 119 | + |
| 120 | +When WHOIS records are updated as described in :ref:`the WHOIS Lookup |
| 121 | +section <controller_whois_auto_management>`, any related estimated |
| 122 | +location will also be updated, if needed and only if the estimated |
| 123 | +location has not been manually modified to increase precision. |
0 commit comments