A Comprehensive Analysis of Magnetic Field Based Indoor Positioning With Smartphones: Opportunities, Challenges and Practical Limitations

The use of the magnetic field data to perform indoor positioning gained an accelerating interest during the last few years. The ubiquity of the magnetic field data makes it a potential candidate for indoor positioning and localization. Additionally, the availability of the embedded magnetic sensor in the smartphones makes it an infrastructure-less approach that requires no additional infrastructure to perform positioning. Despite that, the magnetic field-based positioning is relatively new than those of Wi-Fi, radio frequency identification, and ultra-wideband based approaches and faces many challenges and necessitates a comprehensive investigation of the associated problems for wide applicability. For example, smartphone heterogeneity, mutation of the magnetic field data due to change in the user’s height, time, and device, and low discernibility are a few of the problems that require substantial investigation before the practical deployment of the magnetic field data for indoor positioning and localization. This study contributes by endeavoring a comprehensive analysis of the opportunities and challenges of using the magnetic field data for indoor positioning and localization using smartphones. The pros and cons of the magnetic field data are highlighted through the experiments conducted in various indoor environments using multiple smartphones. The research thus helps in understanding the practical considerations for deploying the magnetic field data for indoor positioning and localization.


I. INTRODUCTION
The wide expansion and proliferation of smartphones brought about the initiation of many new applications, domains, and services like on-the-go services, online marketing, etc. during the last decade. Today, LBs (location-based services) offer a large variety of user-centered applications and services, both outdoor and indoor. Precise location information serves as the backbone for the LBS industry, consequently, positioning and localization have been an active and attractive research The associate editor coordinating the review of this manuscript and approving it for publication was Zhe Xiao . area recently. In addition to the cellular-based systems, GPS (global positioning system) is another positioning technology to serve outdoor positioning with various variations like A-GPS (assisted-GPS), GPS+INS (inertial navigation system), and GPS+camera, etc [1]. However, GPS is regarded as the de-facto outdoor positioning technology that can provide meter level accuracy in many outdoor scenarios [2], [3]. Nonetheless, the positioning accuracy of GPS is highly compromised for indoor environments due to several physical barriers. For example, the advantage of using the data from multiple satellites for enhancing position accuracy for GPS can not be used when the user is indoors. Because the frequency is blocked or attenuated by the walls, roofs, and similar other interfering obstacles. An indoor position can be estimated using GPS, especially, when the user is close to windows, but the accuracy may not be sufficient for indoor environments.
Indoor positioning and localization have gained interest lately, due to several factors; the foremost reason being the widespread usage of mobile devices like tablets, smartphones, and wearable gadgets. Smartphones, in particular, possess enough processing capabilities to perform tasks like online financial transactions, business, shopping, etc. Other than that, a large portion of our time is spent indoors and 80% to 90% of our time is spent indoors and consequently, 70% of cellular calls and 80% of data connections originate from indoor environments like shopping malls, airports, university campuses, and offices, etc. [4], [5]. So, the user's current indoor location is critical for LBS, as well as, emergency response services. Many indoor positioning and localization technologies have been introduced over the past two decades like Wi-Fi [6], [7], RFID (radio frequency identification) [8], [9], IR (infrared) [10], and UWB (ultra-wideband) [11], etc. These technologies are grouped as infrastructurebased and infrastructure-less approaches where the former requires a special set up of hardware and software to perform indoor positioning like UWB, while the latter makes use of already available infrastructure for the same task as the Wi-Fi. The former approaches provide higher accuracy, however, are expensive and vulnerable due to installed infrastructure. Moreover, the positioning is not ubiquitous and infrastructure maintenance is required as well.
In the wake of the competition of the smartphone giants like Samsung, Apple, Huawei, etc. to facilitate their customers, a rich variety of software and hardware applications have been introduced in the latest smartphones including multiple back cameras and embedded sensors. Additionally, IMU (inertial measurement unit) sensors which are MEMS (microelectromechanical system) devices help to organize smartphone accessories to users' preferences. In addition to Bluetooth and Wi-Fi, smartphones encompass accelerometer, gyroscope, barometer, lux meter, and magnetometer and can be leveraged to estimate the user's location as well. Because of this, a significant portion of indoor positioning and localization research comprises of the works that leverage smartphone sensors for positioning. These works use subsisting infrastructure like Wi-Fi and capitalize COTS (commercialoff-the-shelf) applications for user's indoor position estimation. Such approaches are broadly categorized into three groups: Wi-Fi, INS-based, and hybrid. The Wi-Fi positioning is limited on account of many factors. For example, the inherent limitations of radiofrequency like the propagation losses lead to a substantial change in the RSS (received signal strength) [12], [13] that degrades the performance of fingerprinting based Wi-Fi positioning. Besides, signal absorption and shading, multipath shadowing, dynamic environments with human mobility cause signal fluctuation thus introducing high localization error. Signal absorption due to human body loss and the use of various hardware and antenna design also impacts the RSS value [14], [15]. The hybrid approaches utilize both Wi-Fi and INS sensors. INS-based approaches aim to utilize smartphone embedded sensors by estimating the relative change in trajectory and position of the user like PDR (pedestrian dead reckoning). The positive side is that they do not need APs (access points) as Wi-Fi does, the negative side is their need for starting/previous position to infer the next position in time.
The magnetometer is a smartphone embedded sensor that can overcome the limitations of PDR. The magnetometer measures the intensity of the magnetic field at a given point. Analogous to Wi-Fi fingerprinting, the measured intensity of the magnetic field serves as the fingerprint to uniquely identify a position [16]. A large body of works can be found in the literature that used the magnetic field data for indoor positioning and localization due to its ease of adaptation, simplicity, and effectiveness [17]. However, the magnetic field data-based positioning approaches are widely adopted as the magnetic field-based positioning has many limitations. The magnetic field-based positioning is relatively new and not a well-studied research area. For example, the use of multifarious smartphones proves to show different localization results even with the same positioning algorithms. It happens due to the smartphone embedded magnetic sensors that are manufactured from various vendors and have different noise tolerance level and precision. So, a detailed investigative study on the opportunities and shortcomings of using magnetic field data for indoor positioning is imperative to determine its pros and cons. The current study aims at the following objectives • An investigative analysis of the potential and advantages of the magnetic field data for indoor positioning and localization.
• Experimental evaluation and discussion on the accuracy limitation of the localization approaches that utilize magnetic field data for indoor positioning and localization.
• Analysis of variations in the magnetic field data caused by the installation of various electric appliances like a vending machine.
• A comprehensive study of magnetic field data behavior in various outdoor environments like near buildings, open car parking, covered open large areas, and roads near shopping malls, etc.
• Impact of various indoor environments concerning the indoor setting, space, mobility of various electric items on the magnetic field data. It covers the analysis of the data in large halls and underground stations as well.
• An analysis of the magnetic field data in buildings with various construction materials. Modern concrete buildings, old buildings with steel doors and windows, and old buildings built with stone are used for experiments.
• A discussion of probable improvements and suggestions for enhancing the accuracy of the magnetic field based VOLUME 8, 2020 indoor positioning and description of the associated challenges. The current study concentrates on investigating the pros and cons of the practical use of the magnetic field data for estimating the user's indoor position. Section II discusses the research works related to the magnetic field-based indoor positioning and localization. A brief introduction and overview of the earth's magnetic field data are given in Section III. Section IV discusses the advantageous characteristics of the magnetic field data for indoor positioning and localization. Challenges to adopting the magnetic field for indoor positioning are analyzed in Section V. In the end, Section VI provides discussions and conclusion.

II. RELATED WORK
The use of magnetic field data for indoor positioning has been a point of interest for positioning research, both for academia and industry, during the last few years. For this purpose, a large variety of positioning approaches have been proposed such as traditional, filter-based, and machine and deep learning approaches. We divide these approaches into three categories concerning the technique used for indoor positioning: fingerprint approaches, filter-based approaches, and machine learning approaches.
Predominantly, a large number of magnetic field-based positioning approaches follow the fingerprinting approach where the fingerprints are collected at designated ground truth points during the offline phase while the position is estimated with the user collected data during the online stage. Although laborious and time-consuming, the fingerprint approach shows good accuracy in addition to being simple and easy to implement. Such approaches have been utilized, both to provide point level, as well as, room-level accuracy. Similarly, various approaches to make the fingerprint database have been adopted like traditional databases, fast Fourier transform, and a bag of words paradigm, etc. For example, the authors provide an approach to identify a specific room using the magnetic field data in [18]. Fast Fourier transform (FFT) of the magnetic field data is used to build the database and estimate the current room of the user. Room identification based on a modified Manhattan distance indicates a 100% accuracy. For point-based indoor positioning, two kinds of sensors are used for positioning including body hung sensors and smartphone sensors. For example, research [19] uses the magnetic field data for indoor positioning using a fingerprinting approach where the data are collected using a chest hung sensor. Similarly, the authors use a fingerprint database built using a trolley placed HMR2300 sensor for indoor positioning with the magnetic field data in [20]. Such approaches provide good accuracy regarding the use of hung sensors as the data contain less noise and variations. On the contrary, using the magnetic field data from smartphone sensors tends to show poor accuracy as the data from the smartphone sensors contain noise and variation concerning the hand movement of the user. Research [16] points out that using only the magnetic field data does not ensure high positioning accuracy and requires the use of data from complementary sensors like Wi-Fi, Bluetooth, pedestrian dead reckoning, etc.
Combining the data from multiple sensors is a potential way to improve the accuracy of indoor positioning approaches. For this purpose, the data from several sources like Wi-Fi, Bluetooth, and pedestrian dead reckoning (PDR) is utilized either collectively or one can serve to provide a rough initial position which is refined with the data from the other sensors. For example, an indoor positioning approach is presented in [21] where the initial position calculated by Wi-Fi is used to restrict the search space in the magnetic field database. It helps to improve, both positioning accuracy and robustness. Along with the same directions, authors present indoor position using Wi-Fi, smartphone camera image, magnetic field data, and Bluetooth in [22]. User time-specific activities are incorporated as well to enhance the positioning accuracy. Results demonstrate high accuracy to locate the user at specific places. A different approach is introduced in [23] which proposes a multi-scale attention-guided framework. Contrary to the traditional approach where a single feature is extracted from the data input, it defines a scale-based feature extraction by considering the variational anomalies. These features are then prioritized concerning their importance and increase the positioning accuracy by giving more weight to the features with higher importance.
Filter approaches aim at fusing the data from multiple sensors to provide high accuracy for indoor solutions. Often the data is merged using the extended Kalman filter (EKF), particle filter (PF) or their extended variations. For example, research [24] proposes a two-pass bidirectional particle filter to fuse the data from Wi-Fi and the magnetic sensors to enhance the positioning accuracy. A compliant-walking method is proposed as well to ease the fingerprint database construction with increased efficiency. Similarly, [25] use a particle filter to fuse the data from PDR and the magnetometer to ensure high accuracy for the user's indoor position. A pattern making and matching approach is introduced in [26] to alleviate the impact of smartphone heterogeneity and increase positioning accuracy. Another approach that utilizes the Wi-Fi received signal strength (RSS) data to improve the positioning accuracy for magnetic field-based technique is [27] where the Wi-Fi and magnetic field data is fused to increase positioning accuracy. User walking trajectory is built by matching user magnetic data variations with a pre-built database. Filter approaches tend to increase the positioning accuracy by fusing the data from multiple sensors which are complementary and enhance the efficacy of indoor positioning approaches.
Machine/deep learning approaches utilize artificial intelligence-based algorithms for providing a more accurate position of a user indoors. Such approaches following a two-phase process of training and testing. Deep learning approaches are data-intensive and require a large number of training samples and class balance to ensure good accuracy. For example, research [28] present an indoor positioning approach that utilizes data from Wi-Fi, inertial sensors like accelerometer, gyroscope, smartphone camera, and Bluetooth to locate a pedestrian indoor. Initially, a coarse position is estimated using a CNN model that uses the camera image to identify the indoor scene. Initially estimated coarse position can be used to restrict the search space. Wi-Fi is used periodically to fix the drift error of inertial sensors. In a similar fashion, [29] use CNN based model for scene recognition in a multi-story building and utilize PDR and the magnetic field data to provide the user's location. Research works [28], [29] use deep learning models but the models use smartphone camera images for indoor scene identification. The magnetic field data is not used in these models. However, other research works aim to utilize deep learning models that are trained on the magnetic field data. For example, research [30], [31] leverage an ensemble of neural networks which are trained on the magnetic field data to predict a user's current position. An image-based approach is adopted in [32] where the magnetic field patterns are stored as an image to train several CNN. Position prediction is based on the magnetic field patterns from the smartphone magnetic sensor and other sensors like Wi-Fi, or Bluetooth are not used. Recent work on the use of the magnetic field data for indoor positioning is [33] where the concept of augmented magnetic field vector is introduced. Direction-variant augmented vector is used to identify location and heading which minimizes the drift error and increases the positioning accuracy.
The above-cited research lacks in several aspects. First of all, they aim at predicting the user's current position by utilized either the magnetic field data alone or the data from multiple sensors like Wi-Fi, inertial sensors and Bluetooth, etc. The investigation is not carried out to analyze the challenges of using the magnetic field data for indoor positioning. Secondly, although several research works investigate the impact of heterogeneous smartphones, yet only a couple of smartphones are considered for experiments. Thirdly, the impact of placing various electronic appliances indoors like the vending machine, and elevators are not studied. In the end, the experiments are mostly carried out in narrow corridors or small indoor areas, and the attitude of the magnetic field data in large areas or reception hall is not considered. This research aims at conducting an exhaustive analysis of the challenges of using the magnetic field data for indoor positioning and provides an insight on the opportunities and limitations of the magnetic field data concerning indoor positioning and localization.

III. OVERVIEW OF EARTH's MAGNETIC FIELD
Earth's observed magnetic field is called, 'geomagnetic field' (referred to as the magnetic field for simplicity in the rest of the paper). It is mainly generated within the earth's interior making protection called, 'magnetosphere' that saves the planet from dangerous and highly energetic particles arriving from the sun [34]. Additionally, the magnetic field is the earth's safeguard against the solar wind without which the earth can be blown away. The magnetic field is produced by the electric currents in the ionosphere and magnetosphere which is caused by the movement of molten iron at the earth's core. The circulating electric currents in the conductive outer core produces the magnetic field. The motion of currents is triggered by convection and rotation of the earth [35].

A. ELEMENTS OF THE MAGNETIC FIELD
The magnetic field is a vector field which is represented with a magnitude and direction at a given point in space. At any given point P is supposed to be situated at the center of a Cartesian coordinate system, three components x, y, and z of the magnetic field are shown in Figure 1.
The x component of the magnetic field is directed towards the geographic north, the y towards the geographic east, while the z is vertical and positive when directed towards the earth [36]. Two representations are used in the literature to specify the magnetic field, the most common way being the use of x, y, and z components. An alternative way is through the total intensity of the magnetic field F, declination D, and the inclination I . Following equations show how to calculate F, VOLUME 8, 2020 D, and I of the magnetic field where x, y, and z are the components of the magnetic field data while H is called 'horizontal intensity' and considers only x, and y components of the magnetic field. The magnetic field components x, y, and z are represented in micro teslas (µT) or nano teslas(nT) while D and I are given in degrees.

B. DISTRIBUTION OF MAGNETIC FILED
The strength of the magnetic field varies smoothly on earth's surface between 23 µT to 62 µT, being strongest around the poles while weakest around the equator [37]. Magnetic field strength between the poles and equator varies non-linearly, as shown in Figure 2. At polar and equator regions, the magnetic field mostly comprises of a vertical and horizontal plane, thus called 'south' and 'north' magnetic poles, respectively. Magnetic south and north poles are the same as the geographic poles but are tilted approximately 11.5 • degrees from the rotational axis of the earth.
The strength of the magnetic field can be measured using 'gaussmeter' and 'magnetometer'. Gauss meters are highfield instruments and measures the magnetic field with a strength higher than 1 milli tesla (mT) while a magnetometer is used to measure the magnetic fields with a strength lower than 1 mT. Magnetometers are used in the smartphone to measure the magnetic field strength (earth's) which is lower than 1 mT and often measured in µT. Magnetometers are further divided into two types: vector magnetometer and scalar magnetometer (also called total field magnetometers) [39]. The vector magnetometer measures the magnetic field strength in a single vector that contains x, y, and z components of the magnetic field, scalar magnetometer, on the other hand, measures only the magnitude of the magnetic field with no direction. The performance and capability of a magnetometer FIGURE 3. The magnetic field data for the considered scenarios. The data are collected walking in the designated area at a sampling rate of 10 Hz/s. are analyzed through several technical parameters like sampling rate, resolution, thermal stability, noise, quantization error, and tolerance, etc. A more detailed discussion of magnetometer types and their relevant advantages and disadvantages can be found in [39].

IV. ADVANTAGES OF MAGNETIC FIELD DATA FOR INDOOR POSITIONING AND LOCALIZATION A. BEHAVIOR OF MAGNETIC FIELD IN INDOOR AND OUTDOOR ENVIRONMENTS
The magnetic field strength and direction remain similar within a small constrained area. Even within a large outdoor space, its magnitude varies smoothly although non-linearly as shown in Figure 2. To corroborate the behavior of the magnetic field in the outdoor environment, we collected the data in many places. Six scenarios are considered especially for this analysis: • Open area with no buildings close by, • Parking area, • Open area with buildings close by, • Open area with covered roof, • Roads with commercial outdoor area like malls, • Residential area with nearby buildings. Figure 3 shows the behavior of the magnetic field data for the above-mentioned scenarios along with the pictures of the places where the data are collected. As the figure shows, the attitude of the magnetic field data is different for different scenarios. Figure 3a shows that the change in the magnetic field intensity is marginal. The magnetic field intensity varies slightly in the open outdoor environments that are straight without the presence of nearby man-made constructions. The change in the data may be a little higher if we make a turn in different directions. Compared to the open area, the variations in the magnetic field data are high in a parking area, as shown in Figure 3b. The magnetic field is affected by the presence of cars, being made of iron and steel they interfere with the magnetic field. A more detailed analysis of its behavior in the parking area is covered in the following section.  The magnetic field is affected due to the proximity of various ferromagnetic materials like iron, steel, nickel, and cobalt, etc. Man-made constructions use concrete that contains iron and affect the magnetic field data. The effect depends upon the size of the building and its structure. Figure 3c shows the data collected on a path that is approximately 2.5 m away from a building. Magnetic field intensity, as well as, the attitude is different than those of other scenarios.
As stated previously, the magnetic field data is affected differently for indoor and outdoor environments, some cases are special, like the outdoor covered area. Such environments have a different impact than those of both indoor and outdoor. For example, Figure 3d shows the magnetic field data collected under an open covered area. It is apparent that the variation in the magnetic field data is substantial and keeps on changing when the user walks in a particular direction. Similarly, the impact of building in an open area with roads can be observed in Figure 3e. The change in the magnetic field data is slow but substantial. The small changes are due to the symmetry of the building. However, the buildings are close and asymmetric, these changes can be frequent abrupt. Consider, for example, the scenario shown in Figure 3f, where irregular buildings are closely located in a residential area. The magnetic field behavior is analogous to that of an indoor environment.
The proximity of ferromagnetic materials like cars affects the magnetic field differently. The earlier study suggests that the impact of cars is little when the magnetic field data is collected in a parking area [24] from a distance of roughly 1 m from the car. However, the impact of distance from cars is not very well studied. Figure 4 reveals the finding of our experiments. It explains the impact of car proximity on the magnetic field data. Results indicate that the closer we get, the lower the magnetic field intensity will be. Also, small variations can be found in the data displayed in Figure 4 which are on account of slight hand movements. The attitude of the magnetic field data in a parking area reveals that positioning in the parking area is more challenging than the ordinary indoor environment, as, the placement of cars at various place tend to affect the magnetic field data differently and the fingerprint may change every time concerning the distance between a ground truth point and the parked vehicles.

B. SUITABILITY TO BE USED FOR INDOOR POSITIONING AND LOCALIZATION
The magnetic field data is reported in the literature to have been used by various animals and birds [40]. Animals like a sea turtle, lobster, and pigeon follow their way home by sensing the direction using the magnetic field data [41]- [43]. So, researchers investigated the use of the magnetic field data for indoor positioning during the last decade. Literature shows that the earth's magnetic field is uniform and does not mutate sharply over time for a small restricted area. Despite that, the ferromagnetic materials present in man-made constructions like steel-reinforced concrete, metallic doors, pillars, lifts, and elevators, etc. interfere with the natural magnetic field to cause interruptions. Such interruptions make it difficult to find direction using a compass in the indoor environment. Additionally, electric lines and large electric appliances like vending machines are reported to interrupt the magnetic field [44]. However, such disturbance also called anomalies is observed to show unique values at different positions and can be used as 'fingerprints' [16]. Spatial differentiation and temporal stability are the two key characteristics that make a good fingerprint [45], [46]. This study investigates the behavior of the magnetic field data for different buildings to corroborate the findings of previous studies [47].
Results shown in Figure 5 indicate that the magnetic field data in various buildings show different values for most of the positions and can be used as a fingerprint to offer a reasonable position accuracy. The provided accuracy from the use of the magnetic field data may not meet the standard of the indoor positioning, yet, other technologies like Wi-Fi and PDR can be fused to overcome such limitations.

C. LONG TERM STABILITY
Besides spatial uniqueness, long term stability is an important characteristic of a good fingerprint. One of the challenges associated with Wi-Fi-based indoor positioning is the abrupt change in Wi-Fi RSSI that reduces the localization accuracy substantially. Contrary to the Wi-Fi where RSSI is mutated over time, magnetic field data shows long term stability. For corroboration, the data are collected for almost three years, during different times of the day and night. Figure 6 shows the data using Samsung Galaxy S8 for IT building for three years. It indicates that the magnetic field data mutates but slightly. The magnetic field data intensity changes, yet, the patterns formed by the magnetic intensity are observed to be similar. Similar findings are reported in the literature where the behavior of the magnetic field data is monitored for a  long time in the indoor environment [24]- [26], [48]. These studies and the findings of the current study confirm that the magnetic field disturbance in a given indoor environment is stable over time or mutates very slowly, given the indoor environment does not introduce any major infrastructural change. VOLUME 8, 2020

D. TOLERANCE TO DYNAMIC ENVIRONMENT
A substantial research effort has been done during the last two decades, for indoor positioning and localization, especially for those who utilize the in-building communication infrastructure like Wi-Fi. Even so, the Wi-Fi-based approach suffers a high loss in positioning accuracy when operated in a dynamic environment with human mobility. We consider two factors for the dynamic environment: changes made in the infrastructure and real-time changes in the indoor environment. The former refers to the removal or placement of additional furniture, refrigerator, or vending machines while the latter represents the movement of people, as well as, other objects like trolleys, shopping carts, etc. in the indoor environment. Both factors affect the intensity of the magnetic field data in a different way. For example, the impact of the placement of additional furniture on the magnetic field data is minimal, as shown in Figure 7.
The minimal influence of the furniture is due to the steel legs of the desk placed along the corridor. Figure 7a shows the pictures of the corridor taken with and without the furniture. The data are collected while walking through the corridor, along the ground truths marked on the floor. The addition of furniture in the indoor environment does not have a substantial impact on the magnetic field data. On the contrary, large fluctuation in the RSSI values for Wi-Fi is observed with the addition of furniture in the indoor [15], [49]. It asserts the suitability of the magnetic field data for dynamic indoor environments than that of Wi-Fi and other radio propagationbased techniques.
In the same manner, the dynamic environment with frequent human mobility is reported causing fluctuations for Wi-Fi RSSI which compromises the accuracy of the Wi-Fi-based indoor positioning and localization. On the contrary, the influence of human mobility on the magnetic field data is minimal. As stated earlier, the magnetic field data is mainly affected by the presence of ferromagnetic materials and humans do not contain any such materials. Wi-Fi and other radio-propagation technologies experience fluctuations due to signal absorption, shadowing, scattering, and similar other phenomenons. Because of the influence of such dynamic factors on radio-propagation based indoor positioning techniques, the wide application of such techniques is greatly affected. The magnetic field data shows no or less influence on human mobility. Figure 8 shows the impact of human mobility on the magnetic field data. The data are collected for the same indoor environment while walking along the ground truth points using the Galaxy S8 smartphone. Two scenarios like minor human mobility and moderate human mobility are used for data collection. Minor human mobility involves data collection during the noontime between 12:00 pm and 1:00 pm when five to 20 people are either present or walking in the corridor. Moderate human mobility, on the other hand, includes the presence and movement of twenty to forty people in the corridor during the data collection, and the data are collected during morning time between 9:00 am 10:00 am. It can be seen that the influence of human mobility on the magnetic field data is minimal. Such a change in the magnetic field data can be caused by the smartphone's sensor as well and is explained further in the following section.

V. CHALLENGES OF USING MAGNETIC FIELD DATA FOR INDOOR POSITIONING AND LOCALIZATION
The magnetic field data exhibit favorable attributes, as well as, challenging properties regarding its use for indoor positioning and localization. The challenging characteristics include low discernibility, mutation, the influence of indoor changes and smartphone heterogeneity, and user complex behavior. Such characteristics make the positioning process very challenging and affect the average accuracy, as well as, the performance of the positioning approach. Consequently, the study and analysis of such properties of the magnetic field data are of great significance to empower accurate indoor positioning and localization using the magnetic field data.

A. LOW DISCERNIBILITY AND FINGERPRINT VECTOR
Of the challenges of the magnetic field data, low discernibility is of high interest. The intensity of the magnetic field data is very weak and represented in µT. As a result, the same magnetic field intensity is found on multiple indoor locations for any given indoor environment which results in poor location accuracy. Although, the magnetic field data is 3-D, yet using 3-D data for indoor positioning is not very practical due to the frame of reference problem. For ideal use, the frame of reference should be always aligned with the global coordinates which are not very practical. Such alignment restricts the user to use the device with a fixed orientation, i.e., navigation mode (a hand-held device with a y-axis directing towards the navigation direction). If the device orientation can not be fixed then the device attitude needs to be tracked all the time. However, tracking of device attitude has its limitations due to sensor drift and affects the accuracy.
The magnetic field data has two representations, as described in Section III, however, the representation using magnetic x, y, and z is traditionally used for positioning. Even the use of three elements x, y, and z is not ideal due to device attitude and global coordinates problem. Consequently, the use of magnetic field intensity is preferred to avoid such complications. In the 2nd representation, the inclination and declination represent angles and are very sensitive to the attitude of the device and conventionally not used for positioning. Besides, the fingerprint vector used for the magnetic field data is smaller than that used in Wi-Fi and Bluetooth, etc. Due to the wide deployment of Wi-Fi APs, at any given point, RSSI values from several APs are available that increase the length of the fingerprint vector for Wi-Fi. For indoor environments with dense Wi-Fi APs deployment like airports, train stations, and universities, etc. ten to thirty RSSI values can be found on a particular location. Unlike Wi-Fi, the magnetic field data has only three elements to be used for the fingerprint vector which makes it very difficult to perform the positioning.

B. MUTATION OF MAGNETIC FIELD OVER TIME
Despite the long term stability, the magnetic field data is mutated over time, although slowly. Therefore, the WMM (world magnetic model) that is used to estimate the magnetic field strength, is revised every five years [50]. Figure 9 shows the magnetic field intensity for an indoor environment that is collected for three years. It clearly shows that the magnetic field intensity varies over time. However, the mutation over time is slow and smooth and does not experience spikes and abrupt fluctuations, as Wi-Fi RSSI experience. Despite smooth changes in the intensity, several points in Figure 9 show higher variation which indicates that the mutation can have a different value for different locations. Contrary to the magnetic field intensity that changes, the patterns formed by the magnetic field data look similar even for the data collected during different years. Because of the similarity of the magnetic field patterns, several studies adopted the use of magnetic field patterns over the magnetic field intensity VOLUME 8, 2020 and reported promising results [32], [51]. However, using the magnetic field patterns requires a fixed device attitude, as well as, longer data sequences to ensure the indoor positioning and localization accuracy which may be problematic for many complex indoor environments.

C. HOW VARIOUS CONSTRUCTIONS AFFECT MAGNETIC FIELD
Indoor positioning and localization approaches that are based on the magnetic field data utilized the disturbances caused by the materials used in the construction of man-made buildings.
Such disturbances are generated due to the presence of ferromagnetic materials like iron, nickel, and cobalt, etc. that are present in the construction materials. Therefore, different buildings tend to represent the suitability and unsuitability of using the magnetic field data for indoor positioning, depending on the construction materials. Given such reservations, this study performs a comprehensive analysis of the nature of the buildings regarding the impact of the building materials on the magnetic field data and discusses the variation of the magnetic field disturbances. In essence, the data from three types of buildings are analyzed: modern indoor constructions  built with concrete, the old building made with bricks, and historic buildings made with stone. Figure 10 shows the magnetic field data collected from five different buildings including IT (information technology), EE (electrical engineering), CRC, RIC (regional innovation center), and TE (textile engineering) building. These buildings are geographically well separated and have different indoor infrastructure regarding the placement of furniture, door, and other items. The plots show that the magnetic field is disturbed differently in these buildings. The magnetic field intensity is different for various buildings, as well as, the variation in the intensity. For example, IT and CRC buildings have higher variation for the magnetic field intensity than those of other buildings. Higher variations in the magnetic field data tend to represent a higher number of unique fingerprints and show higher localization accuracy. Similarly, the value of the magnetic field intensity is approaching 90 µT as compared to the distribution of 25 µT to 65 µT for the earth's natural magnetic field. Such disturbances depend on the quantity of the ferromagnetic materials used in the construction and placement of lifts, elevators, steel doors, vending machines, and similar other items that interfere with the magnetic field data. Figure 10a shows the data plots while Figures 10b,10c, 10d, 10e, and 10f present pictures of the outdoor, as well as, the indoor of the selected buildings to show the construction material.
Besides five modern buildings, two buildings made of bricks are selected as well for analyzing the magnetic field data. Figure 11 shows the magnetic field data collected in these buildings including ME (mechanical engineering) and BE (business & economics) engineering building. Variation in the magnetic field data is less than that of modern buildings due to a lack of ferromagnetic materials. Despite that fluctuations in the magnetic field data are visible in Figure 11a. VOLUME 8, 2020 It is due to the indoor settings like lifts, doors & doors frames, vending machines, and refrigerators. Despite the lack of ferromagnetic materials for outer walls, inner walls and pillars are made of concrete that contains irons. Similarly, other objects like steel doors, lifts, and machines interfere with the natural magnetic field and cause moderate fluctuations. However, the localization accuracy in such buildings is greatly suffered due to the similarity of the magnetic field data on a large number of location points.
The lack of ferromagnetic materials in a building causes very slight magnetic disturbances. The magnetic field data from a historic building are gathered to corroborate this theory. 'Palacio da Bolsa' (Bolsa Palace), one of the historic buildings located in Porto, Portugal is selected for this purpose. Palace's interior can be divided into two parts: the entrance and inner hall. Information and security offices are built and scanners are installed at the entrance that contains ferromagnetic materials while the inner hall, rooms, and back-side area are left intact of any modern installments as shown in Figure 12d. It is built using stones and does not contain any materials that interfere with the magnetic field data. The doors and windows are made of wood, so they also do not contain any iron, nickel, and cobalt, etc. Figure 12a shows the data collected from the palace and reveals that the variation in the magnetic field data is negligibly low. To observe the variation closely and clearly, the scale of y − axis is changed from [10 100] to [30 50] in Figure 12b, and even at this scale, very small variations can be seen. Figure 12c shows the comparison of the magnetic field data from a modern concrete containing building and Bolsa palace to point out the difference in the magnetic field disturbance. The comparison reveals that the concrete building shows a high variation in the magnetic field data than those of Bolsa palace. It asserts that the buildings that do not contain ferromagnetic materials lack the magnetic field disturbances and are not suitable for the magnetic field-based indoor positioning. than those of other indoor buildings.

D. INFLUENCE OF CHANGES IN INDOOR ENVIRONMENT
Several research works, as well as, the experiments carried out in the current study confirm the long-term stability or slow mutation of the magnetic field data [44], [52]. Similarly, the influence of smaller changes in the indoor environment is reported to have a slight impact on the magnetic field data. For example, as described in Section 3.4, the addition of chairs with steel legs, affects the magnetic field intensity slightly. However, the placement of items containing a large quantity of iron or steel, as in elevators, lift, and vending machines, intervene in the magnetic field substantially. Figure 13 shows the magnetic field data collected beside a vending machine installed in the indoor environment. The data are collected at different distances from the vending machine like 1.0 m, 0.5 m, and 0.25 m. It is clear that as we approach near to the vending machine, the change in the magnetic field data is higher.
It can be argued that such changes are attributed to a change in position, since we move closer to the machine we change location as well. To corroborate whether changes in the magnetic field data are associated with the proximity of the vending machine or the location change, data are collected 2 m beside the vending machine. Figure 14 shows the location of the vending machine and the points where the data are collected to analyze the impact of the vending machine. Figure 14a shows the location of the vending machine on the map. Three points at which the data are collected are shown as brown, black, and blue circles and are located at 1.0 m, 0.5 m, and 0.25 m, from the machine, respectively. The data for corroboration is collected at three points with the same x − coordinates but y − coordinates are moved 2.0 m right. So if the change in the data moving from point 1 to point 3 is the same for both locations, then the vending machine does not influence the magnetic field data. However, if the change in the magnetic field data in front of the vending machine and 2 m beside the vending machine is different, it implies that the impact of the vending machine can not be ignored. Figure 14b shows that the magnetic field data varies between 46.0 µT to 47.18 µT while the range of the magnetic field data in Figure 13 is between 30.05 µT to 47.81 µT. It confirms that the variation of the data is not natural in front of the machine and the ferromagnetic materials in the machine interfere with the magnetic field to cause such disturbances. Moreover, the influence of the vending machine is not mono-direction and observed in all directions. However, the influence depends on the distance from the machine.
Beyond the impact of the vending machine, refrigerator and steel water dispensers generate a similar impact of lesser intensity due to the quantity of the ferromagnetic materials. One potential impact on the magnetic field data is from the lifts and elevators. On account of the volume and weight of these items, the interference of such items is high. In this regard, several experiments are conducted to analyze the impact of lift on the magnetic field data. The impact of lift is investigated both when being still and in motion. Figure 15 shows the data collected on the third floor while standing 1 m away from the lift.
Data plots in Figure 15 reveal that the motion of the lift affects the magnetic field data. The effect motion is different while moving upward and downward, yet the pattern is almost similar as shown in Figure 15a. Similarly, the magnetic field intensity is different when the lift stays motionless on floor 3 and floor 1. The magnetic field intensity is increased when the lift moves to floor 3 than that of floor 1. In the same fashion, when the data are collected while standing on floor 1 the magnetic intensity is different as shown in Figure 15b. It infers that if the magnetic field data are to be used for positioning, lift position is to be known, as well as, the floor at which the user is standing currently which is not very practical for real-world problems.
What is more complicated lies in the movement of the lift when the user is inside the lift. The magnetic field intensity is different when the user is inside the lift. Figure 16a shows the data collected while moving from floor 1 to floor 3 when inside the lift and vice versa. It shows that the magnetic field intensity is approximately 15 µT inside the lift while the magnetic intensity at a distance of 1 m outside the lift is approximately 43µT as shown in Figure 15b. It shows that although the magnetic field data can be used to identify whether the lift is going up or down, its movement interrupts the magnetic field data in its proximity and affects the localization accuracy. By the same token, lift door opening and closing interferes with the magnetic field data and the magnetic field intensity changes substantially. For example, Figure 16b shows the magnetic field intensity is approximately 37µT when the door is closed while the magnetic field intensity is approximately 41µT with the lift door opened. Additionally, when the door starts to open, the magnetic field intensity drops from 41µT to 37µT, and vice versa. Busy buildings with the frequent operation of the lift make it very challenging to utilize the magnetic field data for indoor positioning in the locations closer to the lift.

E. IMPACT OF USING HETEROGENEOUS DEVICES
One of the more serious problems associated with magnetic field-based positioning is devising an approach that can seamlessly work with various smartphones in the same fashion. Due to a rich variety of smartphone companies and models like Samsung, Apple, Huawei, Nokia, and LG, etc. contriving a standard approach has become a complicated task. This difficulty is specifically associated with two factors: the attitude of the smartphone magnetometer and the diversity of magnetometer embedded in various smartphones. Magnetometers embedded in smartphones have specific levels of sensitivity and noise tolerance. Such MEMS sensors cost a few dollars and can not guarantee the same level of accuracy and efficiency as that of magnetometers that cost a few hundreds of dollars. MEMS sensors are attractive due to their small size, as well as, reduced cost. However, when a smartphone embedded magnetometer is used to collect the FIGURE 17. Data collected using Galaxy S8 for same location. The data are collected during a period of 1 hour between 9:00 pm to 10:00 pm with no human mobility. data, the data value may vary slightly, even for the same location. For example, Figure 17 shows the data collected using the same smartphone for the same location during a time of one hour. Even though the indoor infrastructure, as well as, human mobility is the same, variations can easily be observed.
Secondly, device diversity also causes substantial variations in the magnetic field intensity. Such variations are caused due to the embedded magnetometer used in various smartphone companies from various vendors. There is no standard on which the company's magnetometer is to be added in a smartphone, so various smartphone companies do it of their choosing, even, different models of the magnetometers in different brands of their smartphones. Table 1 shows names and descriptions of various magnetometers added in smartphones.
The installation of the magnetometers in the smartphones from various manufacturers cause fluctuations in the magnetic field data even when the data are collected for the same location from various smartphones. Such fluctuations degrade the performance of a positioning approach when used with heterogeneous smartphones. The variations in the magnetic field data vary for different smartphones of the same company. For example Figure 18 shows the magnetic field data collected for the same time using four different devices.
Several solutions have been proposed to overcome the issues of data variation from the same, as well as, multiple devices. For example, device calibration can be used to minimize the change in the magnetic field readings from the same device. For this purpose, swinging calibration is widely used where the smartphone is rotated in a sequence forming the shape of digit 8 along three orientations [56]. A few have used device calibration and offset value to reduce the impact of heterogeneous devices like in [24], [57]. Using sequential measurements than that of a single value has proven to elevate the positioning accuracy [58]. Besides, utilizing the patterns of the magnetic field sequence of measurements show a higher similarity between various smartphones. Consequently, several research works utilize the magnetic field patterns to cope with the device dependency [25], [26], [59]. However, combining the patterns from several smartphones proves to increase the positioning accuracy and reduce the VOLUME 8, 2020 device dependency [51]. Similarly, the influence of nearby placed magnets poses a soft iron effect that also causes variations in the magnetic field data [60]. It requires calibration for each indoor environment where we want to perform the positioning. Despite the proposed approaches and devised methodologies to mitigate the impact of device dependency, the problem is not fully resolved yet and further research is much required to solve the issue.

F. COMPLEX BEHAVIOR OF USERS AND ITS INFLUENCE ON MAGNETIC FIELD DATA
The magnetic field-based indoor positioning is a relatively new research area than that of Wi-Fi, RFID, and UWB, etc. and many of its aspects have not been studied extensively. For example, user behavior is complex with smartphone orientations. Although few orientations are standard and commonly used, like in a pocket, call listening, and messaging, etc., yet many other orientations vary with the user, like swinging the phone in the hand, watching video while walking, and phone in the backpack, etc. In general, such orientations have nothing to do with the quality of phone calls or messages, etc. However, when performing positioning, especially, using the magnetic field data, the positioning performance is severely affected. Changing the orientation of the smartphone leads to substantial variation in the magnetic field data. Figure 19 shows this phenomenon where the data from various orientations of the smartphone are displayed.
The data from three commonly used orientations are shown in Figure 19 where the data are collected for 'in the pocket', 'in hand front', and 'call listening' modes. In pocket refers to the orientation when the phone is in the front pocket of the pants, 'in hand front' represents the navigation mode when the user holds the phone in his hand in front of the body while in the 'call listening' mode the phone is put beside the ear in an upward direction. Magnetic x, y, z, and F components are displayed to show how substantially these components change with change in the orientation. Predominantly, the fingerprinting approach is used with the magnetic field-based indoor positioning where the fingerprints are collected in the navigation mode, i.e., 'in hand front' in the current study. Changing the orientation during the positioning phase where the user collected samples are compared with the pre-built database, cause large positioning errors because the magnetic field values are different during data collection and positioning phases. One solution to this problem is to track phone orientation and transform the magnetic field data to global coordinates using [61] where M G refers to global coordinate system, M p represents the magnetic field data at phone coordinate system, and R x (φ), R y (θ), and R z (ψ) denote corresponding matrices for pitch, roll, and yaw. Continuous tracking of phone orientation is not very practical for real work scenarios, where the user's behavior can be complex and unpredictable. Furthermore, tracking device orientation is erroneous due to the accuracy limitation of MEMS sensors. These sensors contain noise and drift problem which is accumulated over time. If drift error is not corrected, it may lead to a large variation between the actual and estimated position of the user. Large errors usually happen in wide and complex indoor environments. In addition to single phone The attitude of the magnetic field data in the large indoor areas like reception areas or open halls is of special interest as previous research works did not cover this aspect. The majority of the existing works perform positioning in corridors, rooms, and laboratories only. The data are collected in a large reception hall of dimensions 13 ×76 m 2 where the collection path is separated by 2 meters. The data are collected in the same direction for all the paths to analyze the suitability of the magnetic field data for positioning in large halls. Figure 20a shows the indoor place and the paths where the data are collected while Figure 20b shows the data for five paths used for data collection.
The graph shown in Figure 20b indicates that the magnetic field data is different for different paths. Although the hall is wide and there are no steel doors or windows close by, magnetic variations are found from one path to the other that can be used for positioning.

H. ANALYSIS OF MAGNETIC FIELD DATA AT UNDERGROUND SUBWAY STATIONS
Previous studies, as well as, the experiments conducted in the current study suggest that the magnetic field data is influenced greatly by the proximity of various ferromagnetic materials. However, such experiments are conducted indoors for various buildings with no underground floors. We want to investigate how the magnetic field data behaves in underground environments such as train stations, subway stations, etc. Additionally, the usability of the magnetic field data for positioning in such stations is evaluated. For this purpose, the data are collected in subway stations for three scenarios • Magnetic field data without the presence of a train. • How does the presence of a train influence the magnetic field data.
• Impact of train movement on the magnetic field data. Figures 21b and 21c show the data, with and without the presence of the train on the subway station. Results show that the presence of the train causes little change in the magnetic field data. Moreover, the patterns formed by the magnetic field data look very similar. Despite that, the movement of the train has a huge impact on the magnetic field data. As shown in Figure 21d, the magnetic field data fluctuates substantially when the train leaves the stations and then comes to the previous value. The data shown in Figure 21d were collected while standing at the same place.

I. INFLUENCE OF WALKING SPEED ON THE MAGNETIC FIELD DATA
The magnetic field data has spatial uniqueness and little mutations are observed over time. However, when the walking speed of the user is changed, the length of the patterns formed from the magnetic field data change as well. To corroborate, we collected the magnetic field data at four different speeds at the same place. The data are collected in the same direction within a short duration without any human mobility. Figure 22 shows the data collected with four speeds like slow, medium, fast, and very fast walking.
The data show that the length of the patterns varies with various walking speeds, however, the magnetic field value, VOLUME 8, 2020  as well as, the shape of the pattern remains almost similar. The walking speed varies between 0.9 m/s to 1.2 m/s and the data are collected by the same user by holding the smartphone in a fixed orientation.  Table 2 provides a summary of the contributions from the discussed research works that use the magnetic field data for indoor positioning and utilization.
The contributions are discussed concerning seven elements including • Adopted approach like magnetic field data alone or other complementary sensors data like Wi-Fi, inertial, and BLE, etc. VOLUME 8, 2020 • Test area used for experiments concerning dimensions such as small or large area.
• Device used to collect the magnetic field data such as smartphone, body hung sensors, and trolley based sensors, etc.
• Smartphone heterogeneity refers to the use of various smartphones to analyze the efficacy of the magnetic field-based positioning.
• Analysis of various indoor settings like the addition of electric appliances including vending machines, elevators, etc.
• Analysis of magnetic field data attitude for various indoor and outdoor environments.
• Suitability of the magnetic field data for large areas such as reception halls and open spaces.

VI. DISCUSSION AND CONCLUSION
The wide proliferation of modern smartphones paved accelerated the pace of positioning research to meet the needs of location-based services. Consequently, a rich variety of positioning technologies have been devised and developed that work both indoor and outdoor. Contrary to the outdoor environment, indoor environments tend to be more complicated and challenging to perform positioning. To cope with such complications several indoor positioning technologies have been proposed like RFID, UWB, Wi-Fi, Bluetooth, and visible light. However, such technologies depend on additional apparatus in the form of tags, sensors, access points, beacons and LED lights, etc. During the last few years, the focus of the research is to contrive approaches that work with infrastructure-less technologies like the PDR and magnetic field data. These techniques do not need additional infrastructure, in addition to their being pervasive. Indoor positioning approaches like ultrasound offers high position accuracy, yet, the cost of installing and maintaining the infrastructure is high. Magnetic field-based positioning is inexpensive and holds the potential to serve as a key indoor positioning technology. The magnetic field data is appropriate for indoor positioning. Contrary to the outdoor magnetic field data which is uniform with the gradual spatial change, indoor magnetic field data experience disturbances due to ferromagnetic materials like iron, nickel, and cobalt, etc. Such disturbances, also called anomalies, are studied to show unique values for different indoor locations [16]. Indoor settings of various buildings generate unique magnetic field anomalies that can be used for indoor positioning, as well as, identification of particular buildings [62]. The magnetic field data tends to show different values regarding indoor locations and can be used for indoor positioning.
Long term stability is an important attribute that potentially affects the positioning performance of indoor positioning systems. Unlike the Wi-Fi (radio signals) that deplete over time, magnetic field data has long term stability and shows much less mutation than that of Wi-Fi. Smaller changes are observed over two years in the magnetic field intensity, however, the patterns formed by the sequence of values remain similar. The world magnetic model which determines the calculation of the magnetic field value is revised after five years to adjust for the mutation.
Contrary to the RSSI values from Wi-Fi APs that are adversely affected due to indoor infrastructural changes, the magnetic field data is less/not affected by such changes. Experiments conducted to investigate the impact of furniture with iron legs indicate that the magnetic field data changes slightly. Furthermore, human mobility that causes signal shadowing, absorption, and multipath with Wi-Fi-based positioning systems, seem to have almost no impact on the magnetic field data. Similarly, the influence of human mobility slightly affects the magnetic field data. Contrary to radio signals propagation that is absorbed, scattered, or shaded with human mobility, the magnetic field data is the earth's phenomenon and is hardly affected by human mobility. However, the movement of items that contain ferromagnetic materials like steel trolleys, or similar other objects does affect the magnetic field data. The same findings are reported in other studies as well.
The magnetic field data possess the potential to be used as a key indoor positioning paradigm due to the above-mentioned advantages. However, it carries several features that pose a challenge for its practical application to perform indoor positioning and localization. For the most part, the magnetic field data-based positioning uses the fingerprinting approach. Unlike the Wi-Fi-based position vector where tens of APs' RSSI values are available at a given point, the magnetic field data has only three elements that can be used for fingerprint. These elements, i.e., x, y, and z of the magnetic field data have low discernibility of a few µT and the value may repeat at several locations in a large indoor environment. Additionally, the offline phase which involves fingerprint collection at specified points is laborious and requires wardriving from experienced users. Device calibration is needed before the data collection without which the magnetic field data intensity substantially changes [63], [64]. The database collection time and labor can be reduced by adopting a crowdsourcing approach where multiple users collect the data over different times which can be combined into one database, however, the transformation of the data into a single database is not a trivial task [65]- [67].
The fingerprinting often involves the updating and maintenance of the database to cope with the change in the position of APs or RSSI values for Wi-Fi-based positioning approaches. Although the magnetic field data do not have this limitation, yet, it mutates slightly over time that may or may not require the updating of the database. In addition to that, the installation of items that contain ferromagnetic materials like vending machines, elevators, and iron cupboards, etc. indoors can greatly influence the magnetic field data which requires the updating of the magnetic field fingerprint database. Although such installations are not very common, yet, it poses a challenge and reduces the positioning accuracy.
Data collected with the same device may vary due to the sensitivity and noise tolerance of the magnetometer. MEMS sensors are inexpensive devices with limited accuracy and the data can easily get noisy. Another similar challenge is the use of a wide range of smartphones available today. Various smartphone companies install MEMS sensors manufactured from various vendors. These sensors often have different specifications that can affect the quality of the gathered data. With the new model launched, modified, and enhanced models of such sensors are added to increase the efficiency, and often the positioning accuracy with different models of the same company is different.
The use of the magnetic field data with users' smartphones is often more challenging concerning the complex behavior of the user like calling, SMS sending, or phone in pocket, etc. Such actions change the orientation of the smartphone, as well as, the intensity of the magnetic field data. The databases are collected concerning the global coordinates and change in the orientation of the smartphone requires a transformation of the magnetic field data from device to global coordinate transformation. Such transformation requires tracking the behavior of smartphones involving the data from the accelerometer and the gyroscope sensor which adds additional complexity.
Magnetic field-based indoor positioning and localization have been initiated recently for its infrastructure independence, magnetic sensor availability in smartphones, agility to human mobility, and pervasiveness. However, it is not suitable for positioning in old buildings that do not contain ferromagnetic materials. It is an emerging paradigm that necessitates research from academia and industry to investigate its shortcomings and explore its potentials. The major challenge to use the magnetic field data for indoor positioning is handling the device diversity. Despite its shortcomings, the magnetic field data can be used as a complementary approach to enhance the positioning accuracy in hybrid positioning solutions.