Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Maybe this is a dumb question, but how does the weather app know if the user is outside? Many buildings have HVAC systems that are designed to have positive pressure relative to the general environment, and most phone GPS systems are not accurate enough to tell the difference between being inside a building and outside of it on the sidewalk.


That's definitely not a dumb question, it's actually quite nuanced. First I will stress that it's not necessary to know if the phone is inside or outside, because the trends in pressure will be the same. Over a period of 6 hours, the pressure will drop inside if it is dropping outside, and knowing the rate of that drop and the timing of it is key for the weather forecasts.

In the work I've done on this problem we've never been too concerned about inside vs. outside. A much bigger problem is small altitude changes that mess with the exact readings by huge margins, but again, if we're focusing on trends instead of the immediate exact value, we can smooth out the noise relatively easily.

However, to actually answer your question, an app can make a very good guess about whether it is inside or outside. Key sensors and metric for this are: ambient light sensor, humidity sensor, GPS location / barometer. During the day it is normally brighter outside than inside, and during the night is normally brighter inside than outside. So that's clue #1. Clue #2 is to check GPS to see if the user is moving - if you are moving rapidly then you are probably not inside. And if the barometer is rapidly going up and down, but GPS is not changing, then the user is probably inside (elevator, stairs, etc) and that's clue #3.

Again, none of that is necessary to solve for this particular problem, but it's interesting.


I didn't even know that modern smartphones included humidity sensors and/or barometric sensors.


That's essentially a statistics / data analytics question.

Statisticians (et. al) are well versed at receiving a whole bunch of messy data and figuring out the value that they want to observe.

From a rough perspective, I think it would look something like this:

1) There will be a large concentration of people reporting pressures that are on the low side, this is the true outside pressure.

2) There will be clusters of people reporting high pressures, and that will be inside buildings.

3) To ignore funny circumstances where large amounts of people are reporting lower pressures than the true outside pressure (I'm not sure why this might be, but this is not my domain of expertise) you can compare it to the pressure that people are seeing around that area, and to official pressure readings.


Little bit of machine learning and here you go.

The biggest deal is to collect the data. After data arrives, they can then look for any patterns they need. Filter anything that seems wrong.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: