Akylas / oss-weather

An OSS weather app for iOS/Android
MIT License
161 stars 13 forks source link

[FEATURE REQUEST]: add fallback for systems without geocoder (nominatim) #163

Closed AlphaElwedritsch closed 1 month ago

AlphaElwedritsch commented 1 month ago

Hi there, On DivestOS I only get the Longitude and latitude coordinates, but not the city name DivestOS is a Android custom ROM. On all my other devices, iodeOS, calyxOS, Stock ROM I get the city names It's not a issue of any content blocker etc... Weather forecast is working well, only the location is problematic

Any hints? Is microG mandatory if no google services are used?

farfromrefug commented 1 month ago

@AlphaElwedritsch i use system geocoding to detect location from GPS position. I would say that without microG you dont have any system geocoder. I am using LOS and if i dont install microg then android.location.Geocoder is not working. The other alternative within the app is to use a web api to do this. I might think about using nominatim as a fallback (which is what microg is using)

AlphaElwedritsch commented 1 month ago

I might think about using [nominatim](https://nominatim.org/release-docs/develop/api/Reverse/) as a fallback (which is what microg is using) That would be nice. thx

farfromrefug commented 1 month ago

@AlphaElwedritsch it is implemented in latest version. Let me know if it works

AlphaElwedritsch commented 1 month ago

Unfortunately not Still coordinates

Do I have to install nominatim?

farfromrefug commented 1 month ago

@AlphaElwedritsch no you dont. I guess I need to reproduce it. Will try

AlphaElwedritsch commented 1 month ago

May i ask you if there is any progress?

farfromrefug commented 1 month ago

@AlphaElwedritsch sorry i did not find the time to test that again and fix it for you. I need to test with a phone with custom rom but without microg. Which i dont have right now. Will test soon

AlphaElwedritsch commented 1 month ago

Thanks a lot Will be patient

AlphaElwedritsch commented 1 month ago

I could live with that if there was an option to change the location name. so I could change the coordinates to a name. This may be easier than implementing a geocoder. easily editable place names.

Maybe that's an option for you

farfromrefug commented 1 month ago

@AlphaElwedritsch so i tested it with my phone (was actually easy as i can disable geocoder from microg!). It works fine here. A remote call is made and it gets my location without a native geocoder. So something else must be going on on your phone. I created a test version here https://github.com/Akylas/oss-weather/releases/tag/test_version. Could you test with it? If yes then try to do it with it (until you get a new location without "name"), then go into the settings and use the send feedback button. It will send be a report with logcat and stuff (restart the app afterward to ensure the report is sent). Thanks

AlphaElwedritsch commented 1 month ago

@farfromrefug Hi there Thanks a lot for troubleshooting My Debvice Setup: Google Pixel 7a (lynx) with Android 13 DivestOS. No microG installed.

Testscenario: I've disabled personal DNS (no content Blocking filter) and disabled also the DOS implemented Filter List. So no blocker or firewall is enabled anywhere. I've installed the test version. Started it, allowed location permission and searched lacation via GPS. Get still only coordinates Sent feedback. Did it as you described. Hope you received it.

Maybe it is different to have microG installed but location service disabled as no microG is installed or enabled in general.

farfromrefug commented 1 month ago

@AlphaElwedritsch thanks got the report and saw what s happening. Next release should have a fix for you. PS: for reference the issue is that in your case there is no thrown error (like no geocoder) but simply the geocoding returns 0 result. Theoretically in this case you should end up with just lat/lon as you have but seeing this also happens in your case (no real geocoder), but as i have no way to differentiate, i will make a network call in both cases

farfromrefug commented 1 month ago

@AlphaElwedritsch new version is up

AlphaElwedritsch commented 1 month ago

That works I get a location name It is not accurate (gives me the village besides me) but it works

Thanks a lot

AlphaElwedritsch commented 1 month ago

I did a bit research Are you looking over OSM to get the location name? For me it seems so If I search lat/lon on OSM I get the village name followed by Association community And I get displayed the Association community instead of the village name in OSS weather

farfromrefug commented 1 month ago

@AlphaElwedritsch i use nominatim which was created just for that. It is also what microg is actually using as a géocoder. Not sure i can do more about accuracy. But will check my code

AlphaElwedritsch commented 1 month ago

https://nominatim.org/ using OSM data

https://nominatim.openstreetmap.org/ui/search.html?q=49.124%2C8.13

The location is "Steinweiler" but I get "Kandel"

the order is: House number Street Location Association community district Federal State Postal code country

It is not my real address

farfromrefug commented 1 month ago

@AlphaElwedritsch indeed seems wrong. You should report that issue to nominatim

AlphaElwedritsch commented 1 month ago

Thank you very much for your fast implementation and reaction. For me it's OK now and I will close this issue as resolved. Maybe you will find out more to get better accuracy. But it's not that important.

Thanks again. I love this app...

AlphaElwedritsch commented 1 month ago

Fixed