Location area code used instead of tracking area code for LTE signals causing MLS to fallback to IP-based location
When an LTE tower is used, the LAC will sometimes return 0000 or FFFE, which are invalid LAC codes according to the 3GPP specifications. In the case of LTE, the MLS geolocation API indicates that the TAC (tracking area code) should be used instead. https://ichnaea.readthedocs.io/en/latest/api/geolocate.html#cell-tower-fields
When this case occurs, MLS will return something like this: {"location": {"lat": 45.1334, "lng": -76.1494}, "accuracy": 25000, "fallback": "ipf"}
This indicates that it is using IP-based geolocation and ignoring the cell phone tower ID, which is often very inaccurate.
A proposed fix is to add code similar to the following to the two places where the lac is being retrieved from the modemmanager:
lac = mm_location_3gpp_get_location_area_code (priv->location_3gpp);
+ // Most likely this is an LTE connection and with the mozilla
+ // services they use the tracking area code in place of the
+ // location area code in this case.
+ // https://ichnaea.readthedocs.io/en/latest/api/geolocate.html#cell-tower-fields
+ if (lac == 0x0 || lac == 0xFFFE) {
+ lac = mm_location_3gpp_get_tracking_area_code(priv->location_3gpp);
+ }
Once this fix is in place then submitting cellular location based data to MLS with the "submit-data=true" flag set in the configuration should being to update their database with the LTE cell phone tower locations.