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

Use the biggest/smallest address as appropriate when using the address +/- buttons #3149

Closed
peternewman opened this issue Aug 10, 2021 · 12 comments
Assignees
Labels

Comments

@peternewman
Copy link
Collaborator

peternewman commented Aug 10, 2021

Use case
If you tag a pair of semi detached houses or a terrace with multiple house numbers (e.g. 12-14 or 21,19,17), currently it just appears to take the first (or last) number it parses when you press +/- to number the next property.

Proposed Solution
Store the biggest (14/21) and smallest (12/17) values separately from the parsed house numbers and use the appropriate ones to suggest the next house i.e. 11/16 for - or 15/22 for + in my examples.

@smichel17
Copy link
Member

Complication: 12-14 might be the full address, not "houses twelve through fourteen". In New York City, the first number often indicates which street/avenue it is between (example). So in that case, I'd rather if 12-14 were incremented to 12-15.

I don't think there's a way to do the right thing in all situations, so just let's pick the one that does the best overall.

@westnordost
Copy link
Member

Can not reproduce.

@westnordost
Copy link
Member

Please provide some examples addr:housenumber for which it does not work.

@westnordost westnordost reopened this Aug 10, 2021
@westnordost westnordost added the feedback required more info is needed, issue will be likely closed if it is not provided label Aug 10, 2021
@peternewman
Copy link
Collaborator Author

Complication: 12-14 might be the full address, not "houses twelve through fourteen". In New York City, the first number often indicates which street/avenue it is between (example). So in that case, I'd rather if 12-14 were incremented to 12-15.

Yeah I just gave that as an example (which admittedly I didn't test), I know I'd seen the issue, but couldn't remember exactly where.

Personally I try and avoid it due to the ambiguity, especially if I actually mean 12 and 14 but not 13.

I don't think there's a way to do the right thing in all situations, so just let's pick the one that does the best overall.

👍

I do accept if you were tagging both sides of the street at once (with odds/evens split) then in some circumstances, this behaviour may be useful, but only if the numbers aren't clockwise around a cul-de-sac and are equally offset.

Please provide some examples addr:housenumber for which it does not work.

Tag 12,10
Hit + on the next house
Get 11

Tag 12,10
Hit - on the next house
Get 11!

10,12 works correctly incrementing and decrementing as does 12-14.

With my second made up original example, I get an even more unusual behaviour:
Tag 21,19,17
Hit + on the next house
Get 18

Tag 21,19,17
Hit - on the next house
Get 20!

Likewise with 21-17.

FWIW, I do this where it matches the order of the houses (from left to right as that's how English is written).

@westnordost westnordost added bug and removed feedback required more info is needed, issue will be likely closed if it is not provided labels Aug 10, 2021
@westnordost westnordost self-assigned this Aug 10, 2021
@westnordost
Copy link
Member

Can you explain why one would tag housenumber ranges in descending order? I never did that and I am not sure if such tagging should be expected.

@peternewman
Copy link
Collaborator Author

peternewman commented Aug 10, 2021

Can you explain why one would tag housenumber ranges in descending order?

FWIW, I do this where it matches the order of the houses (from left to right as that's how English is written).

So given houses numbered like this in a terrace:
21 19 17 15
I would tag them as:
21,19,17,15

To give you a hint which end of the block the number you want may be, like a basic version of interpolation.

Also in particularly long runs of numbers, it's far easier and less risk of errors inputting them as I walk along (if I'm walking the right way).

I never did that and I am not sure if such tagging should be expected.

I didn't spot anything in the wiki recommending it, or equally advising against it.

There are 19 instances of 3,1 across at least 4 countries:
https://taginfo.openstreetmap.org/tags/addr%3Ahousenumber=3%2C1

Versus 1084 of 1,3:
https://taginfo.openstreetmap.org/tags/addr%3Ahousenumber=1%2C3

Or 11 of 5,3,1:
https://taginfo.openstreetmap.org/tags/addr%3Ahousenumber=5,3,1

In my experience there are generally many fewer numbered that way than the other way round anyway.

@westnordost
Copy link
Member

Okay, that was much more effort than expected... wouldn't have done it if I knew before. But now, it works with any weird combination:

21/4, 4c +: 22 -: 3
18a-12d, 2, 6-8 +: 19 -: 1
etc

@westnordost
Copy link
Member

westnordost commented Aug 11, 2021

Actually, I changed it so that reverse ranges (f.e. 16-2) are interpreted to mean basically the same as 16/2.

So

21/2, 4c +: 22 -: 3
(and not +: 22, -: 1)

@peternewman
Copy link
Collaborator Author

Okay, that was much more effort than expected... wouldn't have done it if I knew before. But now, it works with any weird combination:

Thanks for that @westnordost and sorry for finding an awkward one!

Actually, I changed it so that reverse ranges (f.e. 16-2) are interpreted to mean basically the same as 16/2.

Ah cool, I was a bit confused about one test case, but I guess that makes sense from what @smichel17 said.

From looking at the tests, I'd think these should also be true:
4<4c
4c<5

But I appreciate you might not want to deal with that level of complexity!

@westnordost
Copy link
Member

westnordost commented Aug 11, 2021 via email

@peternewman
Copy link
Collaborator Author

Very true, I didn't know if it would upset the sorting/max stuff if the values weren't comparable and if it might just discard them?

e.g. 2, 4, 6A, 6B should give +7, -1

@westnordost
Copy link
Member

e.g. 2, 4, 6A, 6B should give +7, -1

yes

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

3 participants