w3c / geolocation-sensor

Geolocation Sensor
https://www.w3.org/TR/geolocation-sensor/
Other
59 stars 21 forks source link

Barometer altitude (if the device has barometer) #43

Open karianpour opened 4 years ago

karianpour commented 4 years ago

I wish that this API could provide barometric altitude as well. The use case is for sport activity when we need precise altitude data in the track log, where the GPS altitude is accurate but not precise.

tomayac commented 4 years ago

@anssiko Maybe altitude could be a separate sensor?

anssiko commented 4 years ago

This is very timely given we're rechartering and have an opportunity to add new sensor types.

Do we have evidence this feature is widely supported i.e. exposed through platform APIs on relevant platforms (plural) that have significant market share? Basically, we need to make a case it can be implemented (in technical sense) across at least two independent web engines. Preferably across two or more different platforms.

tomayac commented 4 years ago

The iOS Compass app that is installed per default on iOS devices reports the altitude.

Android exposes the air pressure, which can be used to calculate the altitude.

anssiko commented 4 years ago

Proposal:

No changes are needed to the proposed charter in order for the DAS WG to consider barometric altimeter a new location information source in the context of the Geolocation Sensor.

We'll keep this issue open to gather further input on design considerations.

anssiko commented 2 years ago

@karianpour via https://lists.w3.org/Archives/Public/public-device-apis/2021Oct/0000.html

I wanted to point out that in some sports, like paragliding, the background tracking needs the barometric altitude as well as gps altitude. I know that some devices might not have the barometer, but it would be perfect to be able to access it if it is present.

Thanks for the proposal. We encourage you to continue append your feedback to this GH issue.

Helpful would be to expand on the use cases that require both high accuracy and high precision.

Now revisiting this issue after some time, I want to note typically Web APIs abstract out implementation details such as whether barometer or GPS, a fusion of both, or some other hardware, is used to measure the altitude. There are exceptional cases (see GPS spoofing attacks) where this might fail, but generally leaving these as implementation details work out well.

I believe browser implementations could already use the underlying OS APIs such as pressure and fuse with GPS for both high accuracy and high precision altitude. I'd like to understand the use cases better where this type of fusion is not working out and require the use of barometer (only?) directly. Earlier enableHighAccuracy flag caused interoperability issues, so we want to learn from that too.

karianpour commented 2 years ago

@anssiko I understand you concerns. Having separate info from every sensor (if present) should work in this use case. Generally in foreground operation there will be no issue as we can get what ever sensor data. But, my concern is background operation, I do not know the background operation api details, but if we are able to subscribe multiple sensor info for background operation it should be enough to do every use case.

So here are more detailed use cases:

Of course we need the user confirmation to do the above tasks.

anssiko commented 2 years ago

@karianpour thanks for your expanded use cases. As you know, when defining Web APIs, we need to optimize them for the common use cases primarily. Even if paragliding could be consider a niche use case (and I'm certainly not an expert in paragliding!), your detailed description really helps us understand the problems you're facing and assess whether these requirements generalize.

If you have specific feedback with regards to Accelerometer or Gyroscope, we appreciate feedback via separate GH repos similarly: https://github.com/w3c/accelerometer/issues and https://github.com/w3c/gyroscope/issues

jzijp commented 2 years ago

Hello, a few use cases for the barometer:

You should know that the returned GPS altitude is never very good, and above all fluctuating. GPS records with GPS altitudes overestimate the height differences by around 10 to 30%. Barometric altitude does not encounter these problems and provides much more reliable results.

All the major services which analyze the GPS files generally recalculate the altitudes (with a DEM) when they come from the GPS.

Use case : Walking / Running / road biking / mountain biking, to know with precision the height difference made during an outing, and here we are not in the niche use case !

Thanks