4 | | == Missing coordinate(s) == |
| 4 | == Invalid coordinate(s) == |
| 5 | === Detecting === |
| 6 | The detection of invalid coordinates doesn't have to be very complicated. Values as '0.000' or 'null' should be easy to catch. The problem lies within 'valid but invalid' values. Say you have: |
| 7 | {{{ |
| 8 | latitude, longitude |
| 9 | 52.1000, 4.1000 |
| 10 | 52.2000, 100.0000 |
| 11 | 52.3000, 4.2000 |
| 12 | }}} |
| 13 | It's obvious the longitude '100.0000' is out of place here. Since this project's focus is Leiden, a boundary could be set. Every value that exceeds that boundary can be marked as invalid. |
| 14 | |
| 15 | The other problem could be that a value could be invalid, but still be inside the boundary: |
| 16 | {{{ |
| 17 | latitude, longitude (range 52-4/55-7) |
| 18 | 52.1000, 4.1000 |
| 19 | 54.5000, 4.2000 |
| 20 | 52.2000, 4.3000 |
| 21 | }}} |
| 22 | The second latitude seems invalid, but is in this case still within the valid range. |
| 23 | It might be possible to spot this value though. You could calculate an average offset in lat/lon, and everything that exceeds the average could be marked as invalid. The catch is that this might be heavy cpu-wise since a lot of calculation is needed. |
| 24 | |
| 25 | === Solutions === |
24 | | Say we still have these 100 missing rows, but your first coordinate is at the start of a street, and the last at the end of that same street. This is more likely to occur when you measure at fair intervals. |
| 45 | Say we still have these 100 missing rows, but your first coordinate is at the start of a street, and the last at the end of that same street. This is more likely to occur when you measure at fair intervals. In this case, it can't hurt to calculate the estimated route. However, if the street has an 'L' shape which you followed, coordinates are likely to intersect with houses and such. |
| 46 | |
| 47 | == Invalid signal strength == |
| 48 | You might encounter missing or invalid signal values. Let's assume the following is measured from the same accespoint. (right now, signal strength is '100 + signal_dbm') |
| 49 | {{{ |
| 50 | signal_dbm, strength % |
| 51 | -80, 20% |
| 52 | invalid values |
| 53 | -50, 50% |
| 54 | }}} |
| 55 | Again, it might be wise to calculate an average to replace the invalid values. But say, someone else measures the same accespoint around the same location, and he receives valid values. Our average would be 45%, but he get's a 90%, or maybe a 5%. |
| 56 | For this, it might be better to look at the history of the accespoint (assuming there is one, if not, there probably will be one in time). You could take the most recent dbms measured at around the same location: |
| 57 | {{{ |
| 58 | signal_dbm (older), strength % (older) |
| 59 | -75, 25% |
| 60 | -90, 10% |
| 61 | -60, 40% |
| 62 | }}} |
| 63 | The first and third value don't show a lot of difference, so it should be fairly safe to take the old second value, and use it for the new measurement. |