| CPC G01R 33/0094 (2013.01) [B60W 40/06 (2013.01)] | 7 Claims |

|
1. A method for determining a road type, the method to be performed by an electronic device which is installed with a positioning system, the electronic device including a magnetic field sensor that is implemented by one of a magnetometer and a microelectromechanical systems (MEMS) magnetic field sensor, the method comprising:
transmitting, when the positioning system determines that the electronic device is approaching an environment having multi-level roads where the positioning system is prone to falsely determining a level of a road, a command to activate a function of determining the road type;
measuring, by using the magnetic field sensor for a preset period, a magnetic field of the environment in which the electronic device is located to obtain a plurality of magnetic field values based on a result of the measurement;
calculating an absolute value of a difference between every two adjacent magnetic field values among the magnetic field values sorted in chronological order;
calculating an average of the absolute values related to the magnetic field values, and making the average serve as a variation value for the environment;
determining whether the variation value is smaller than a predetermined threshold value;
when it is determined that the variation value is smaller than the predetermined threshold value, determining that the environment is a surface road;
when it is determined that the variation value is not smaller than the predetermined threshold value, determining that the environment is a non-surface road;
the positioning system obtaining road information and traffic information based on the determination that the environment is one of the surface road and the non-surface road; and
the positioning system performing navigation by providing to a user the road information and the traffic information, which match the road the user is currently on so the user is able to correctly navigate through the environment having multi-level roads.
|