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

Regression: wrong boundary detection (wrong signs shown in Germany) #1007

Closed
RubenKelevra opened this issue Apr 9, 2018 · 25 comments
Closed
Assignees
Labels

Comments

@RubenKelevra
Copy link
Contributor

RubenKelevra commented Apr 9, 2018

In v5.0b1 a wrong type of maxspeed sign is shown, well within German borders.

@RubenKelevra
Copy link
Contributor Author

RubenKelevra commented Apr 9, 2018

The bikelane markings look wrong too. They are usually white not yellow in Germany.

@RubenKelevra RubenKelevra changed the title Regression: wrong maxspeed sign for Germany Regression: wrong boundary detection (wrong signs shown in Germany) Apr 9, 2018
@westnordost
Copy link
Member

Could you state the geo positions of these screenshots for reproduction?

@westnordost
Copy link
Member

This bug might be very high priority.

@westnordost westnordost added the bug label Apr 9, 2018
@westnordost westnordost self-assigned this Apr 9, 2018
@westnordost
Copy link
Member

I cannot reproduce this on my phone at that location. What is your android version, language and device?

@westnordost
Copy link
Member

Do you have Android Studio installed?

@westnordost
Copy link
Member

westnordost commented Apr 9, 2018

Could you please download, install and start the attached Android application on your device (rename .zip to .apk), zoom into the location where the two screenshots above happened and click on the map there? What country code is shown for these locations?

(Or, if you have Android Studio installed, you can build it yourself, it is the sample app included in https://github.com/westnordost/countryboundaries )


countryboundaries-debug.zip

@matkoniecz
Copy link
Member

I cannot reproduce this on my phone at that location.

Can you share the location? I would test whatever I am able to reproduce.

@westnordost
Copy link
Member

@matkoniecz
Copy link
Member

I am unable to reproduce reported behavior.

@matkoniecz
Copy link
Member

BTW, where yellow cyclelane and MAXIMUM are supposed to be appearing?

@westnordost
Copy link
Member

Yellow cycle lane should appear in Switzerland, MAXIMUM in Canada.

@westnordost westnordost added the feedback required more info is needed, issue will be likely closed if it is not provided label Apr 9, 2018
@rugk
Copy link
Contributor

rugk commented Apr 9, 2018

Uh, but that is really bad then as these positions are far away. 😆 How can it detect one position for one quest and a position on the other hand of the globe on the other?

Also is not this an issue with https://github.com/westnordost/countryboundaries? So could not the OP try to reproduce with the sample app? (easier if westnordost/countryboundaries#1 is done, maybe)

@matkoniecz
Copy link
Member

Yellow cycle lane should appear in Switzerland, MAXIMUM in Canada.

Thanks, for me everything works normally (MAXIMUM in Canada, yellow cyclelanes in Switzerland, what I would expect in Poland...)

@RubenKelevra
Copy link
Contributor Author

RubenKelevra commented Apr 9, 2018

Yeah sure it's within the boundaries of Wuppertal, NRW, Germany. I'm not sure on which street the second one was taken but I was in Wuppertal.

Android Version is 8.0, local is German. On a OnePlus A5010 (it's better known as 5T).

@westnordost the way is exactly the right segment of this street where this bug occoured. I did the change and the next quest was the maxspeed one, opend automatically.

@RubenKelevra
Copy link
Contributor Author

So, here's the requested test:

Both applications at the same location, just retested. And reproduceable for me.

@westnordost
Copy link
Member

westnordost commented Apr 9, 2018

Okay, so it is not a problem in the countryboundaries library but in the (Android) resource selection in StreetComplete. This makes the bug not critical, as the bug is only in display.

I will try to reproduce it on an Android 8.0 emulator.

Do you have Android Studio installed?

(I also wonder why it takes so long (1.8ms) to find it out, it should be more along the lines of 0.2ms. Does it always take this long when you click on other random locations on the map?)

@francois2metz
Copy link

Same here in France. The sign here are different than the screenshot.
screenshot_20180409-180659

@matkoniecz
Copy link
Member

Same here in France

Can you link this location? (just navigate to this place at https://www.openstreetmap.org/ and copy url)

@francois2metz
Copy link

@westnordost westnordost removed the feedback required more info is needed, issue will be likely closed if it is not provided label Apr 9, 2018
@westnordost
Copy link
Member

Can reproduce on Android 8.0

@westnordost
Copy link
Member

westnordost commented Apr 9, 2018

Okay, I understand the problem. For the street sign layout, there are three different resources:

  1. a default one
  2. one that should only be used for en-US
  3. one that should only be used for en-CA

StreetComplete uses the following hack to access certain resources by country only, independent of the language, which is not possible directly in Android:

protected final Resources getCurrentCountryEnglishResources()
{
	Configuration conf = new Configuration(getResources().getConfiguration());
	conf.setLocale(new Locale("en", getCountryInfo().getCountryCode()));
	return getContext().createConfigurationContext(conf).getResources();
}

My expectation was that the Android resource management system will then give me the layout for en-US only if the country code is US and otherwise give me the default one but apparently on newer Android versions, the resource resolution algorithm became more fuzzy so that en-DE will fall back to the en-US or apparently sometimes also en-CA resource instead of the default resource.

@RubenKelevra
Copy link
Contributor Author

RubenKelevra commented Apr 9, 2018

@westnordost well, that was more a peak than the mean. So 80% of the time it's between 0.150 and 0.800 ms. But sometimes it's a bit above 2ms and in CH I saw values above 6ms for the first 3-4 positions, than it dropped. Overall the speed seem to improve after the first several locations in a country, looks like a kind of catching works here to improve it.

Overall, the delay feels longer in the app you provided. Between touch and the display it feels like 200-400ms, maybe just the "animation" of the box. 😉


Your fix sounds good, just out of curiosity, if I switch my device to English like "EN-US", are then US signs showed or the German ones, when I select a task in Germany? 🤔

Thanks for the fast response to this! 🤘

@westnordost
Copy link
Member

westnordost commented Apr 9, 2018

Yes, it feels slower because of that fading-in-fading-out box (it's called a toast in Android-sprech).

Your fix sounds good, just out of curiosity, if I switch my device to English like "EN-US", are then US signs showed or the German ones, when I select a task in Germany? 🤔

Always the resources for the country the quest is displayed in should be selected, independent of your device's location and of your device's locale. With the fix, this is now the case also for newer Android versions. So if you go to America, you will again see the white "SPEED LIMIT" boxes.

@RubenKelevra
Copy link
Contributor Author

... which is great. This solution meet exactly my expectations :)

@RubenKelevra
Copy link
Contributor Author

Checked and I can confirm a successful fix for v5.0b2.

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants