-
-
Notifications
You must be signed in to change notification settings - Fork 875
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set correct light pollution level when location=auto #4216
Conversation
Great PR! Please pay attention to the following items before merging: Files matching
This is an automatically generated QA checklist based on modified files. |
Where will it ultimately come from? |
From our database if city name is known |
@10110111 could you check how works getting the location (and light pollution level) from IP for St. Petersbourg? |
Not sure about SPb, since I don't have access to my machine there, but for Kuta, Indonesia I get a very wrong location:
So there's no city, but the coordinates indicate Jakarta. And when I choose light pollution setting "From location database", the value gets set to Bortle class 2, which is very wrong for Kuta that's the brightest part of Bali, and just as well wrong for Jakarta that's the brightest part of Java. I think it would be better to use some kind of a light pollution map instead of a city-based table. E.g. The World Atlas of the Artificial Night Sky Brightness. |
The IP-based location lookup has set me to places 18km (regularly) or even 160km away from my place. It seems OK to set the location close enough to get a roughly correct sky, but for anything else we'd need more. Looking up the IP-based coordinates in a LP database will therefore also not really help. The various OSes have introduced their own location APIs which may work better, but many users dislike being "tracked". Should we try to make use of that? |
Isn't it just an API to the GPS sensors, whose input we already support? |
They must do something around network traffic. My desktop PC and laptop don't have sensors, but in the system control panel there are settings that work considerably better than our IP-based lookup. |
Well, if it's indeed something more than the GPS, then I suppose we could add support for this, maybe as a button near the "Get from GPS" one. |
Ah yes, it's in Qt... https://doc.qt.io/qt-6/qtpositioning-index.html EDIT: I am trying my luck on this right now... #4221 |
Added code for processing locations, which presents by coordinates only |
Probably 1/2 degree (55km) is still too large anyhow, but in dense areas you may get several entries even in 0.2 deg radius. I have added some debug messages. I cannot test this because my network retrieval finds a known city.
At least it works now (not 100% good but better than nothing) |
Description
This patch should obtaining a realistic light pollution level for auto discovered locations (at least for big cities)
Fixes #2762 (issue)
Type of change