Skip to content
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

Automatic Region Detection #35

Closed
ckrey opened this issue Feb 18, 2021 · 7 comments
Closed

Automatic Region Detection #35

ckrey opened this issue Feb 18, 2021 · 7 comments
Assignees
Labels
done Bug fixed or enhancement implemented enhancement New feature or request

Comments

@ckrey
Copy link
Collaborator

ckrey commented Feb 18, 2021

No description provided.

@selphiron
Copy link
Contributor

The following prompt shall be shown to the user when the app is started if
A and ((B and C) or D) is true
A = The user has not pressed the "Don't show this again"-button before
B = Last seen region ID is smaller than the new region ID from the backend
C = The selected region is "UNKNOWN" or "other"
D = The selected region is not among the top three nearest regions

region_prompt_en
region_prompt_de

If "Don't show this again" is tapped on, the prompt is dismissed and does not appear again.
If "Later" is tapped on, the prompt is dismissed but does appear again, if the above condition is met.
If "Yes" is tapped on, the Profile menu opens and the focus is set to the region part.

Since we have over 70 regions now, finding the correct region in the dropdown menu can be exhausting. A switch in the Profile menu should switch between the dropdown and a button. By pressing the button, the 3 nearest regions are shown to the user and he can select one of them or cancel.

For this purpose, a new API endpoint was created:

<URL-to-backend>/12/check-regions?clientHash=<client-hash>&lastSeenRegionsID=<int>
Note that the backend version changed from 11 to 12.
clientHash is calculated like in the uploads.
lastSeenRegionsID is an integer of the last seen region file version.

A succesful response is either a 200 with an empty body or a 200 with the folowing content:

#<RegionsID>
#<English Region Name>=<German Region Name>=<Backend Region Name>=<Coordinates of the region>

...
The last column <Coordinates of the region> is new. It contains a GPS location in form of latitude,longitude . Not every region/line has the last column. Those without shall not be considered when calculating the nearest region. For instance, the region "other" does not have the last column.

A line beginning with a ! is still to be ignored.
example:

#1
Please Choose=Bitte auswählen=UNKNOWN
Berlin/Potsdam=Berlin/Potsdam=Berlin=52.31,13.24
!London=London=London
Other=Sonstiges=other
Bern=Bern=Bern=46.94,7.44

The three nearest regions are calculated by comparing the current GPS location to the GPS locations from the regions file described above.

@selphiron selphiron added the enhancement New feature or request label Apr 7, 2021
@selphiron
Copy link
Contributor

A 200 with an empty body means that the regions did not change.

@ckrey
Copy link
Collaborator Author

ckrey commented May 3, 2021

Done

@ckrey ckrey added the done Bug fixed or enhancement implemented label May 3, 2021
ckrey added a commit that referenced this issue May 3, 2021
@selphiron
Copy link
Contributor

We need a small change to this. We do not want uploads with region UNKNOWN anymore. Therefore, the region prompt form above is changed to this:

region_prompt_EN
region_prompt_DE

Furthermore, when the upload button is clicked and the region is UNKNOWN, this prompt will be shown to the user instead of triggering the upload.

And show this prompt to every user once after the update. Even if the user has already set a region.

@ckrey ckrey added done Bug fixed or enhancement implemented and removed done Bug fixed or enhancement implemented labels May 4, 2021
@treh
Copy link
Contributor

treh commented May 13, 2021

Is it really the right direction where this is going?

It should be easily possible to identify the region from the trip location data. There should be no user input necessary and it could be done in the backend (even retrospectively for already received data).

The ongoing proposal uses current location, bothers the user (in some cases at app startup time, which is worst) and depends on app state ("Don't show again"). Apologies if this comes off as snarky, I don't mean it that way! I'm just curious: What are the points in favor of this design?

@selphiron
Copy link
Contributor

We can determine the region of each ride using the GPS information contained in that ride. But it gets complicated when a ride goes through multiple regions. In that case, it is up to the user to choose his/her region.
Additionally, we cant determine the region of the profile file that is also uploaded with each ride upload. We need them for making statistical statements about our userbase.

@ckrey
Copy link
Collaborator Author

ckrey commented Apr 26, 2022

Closing issues as it is already in production

@ckrey ckrey closed this as completed Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done Bug fixed or enhancement implemented enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants