faker icon indicating copy to clipboard operation
faker copied to clipboard

Building number returns incorrect data for PL

Open Mikilll94 opened this issue 2 years ago • 14 comments

Pre-Checks

Describe the bug

The implementation of buildingNumber for PL is incorrect because it can return i.e. 4/2 which is not a valid building number in Poland. https://github.com/faker-js/faker/blob/next/src/locales/pl/location/building_number.ts

4/2 in Poland means:

  • 4 is the home number
  • 2 is the flat number

I think this applies also to most countries in Europe.

Additional Context

We should remove '#/#' from buildingNumber patterns for PL.

Environment Info

N/A

Which module system do you use?

  • [ ] CJS
  • [X] ESM

Used Package Manager

npm

Mikilll94 avatar Apr 27 '23 20:04 Mikilll94

@rybaczewa You added those, can you please give some feedback on this?

  • https://github.com/faker-js/faker/pull/1055/files#diff-8f9060bcfa6a715e97b8d1721510bbba3fab188e5cc0ba10f32c2e3699c7a852R1

ST-DDT avatar Apr 27 '23 20:04 ST-DDT

"4/2", alternative "4 m. 2", means building 4, apartment 2

So it would make sense to remove '#/#' from building_number and add '/#', '/##' as alternative secondary_address formats?

https://github.com/faker-js/faker/blob/next/src/locales/pl/location/street_address.ts

would need to remove the space between buildingNumber and secondaryAddress here so its still formatted correctly

full: '{{location.street}} {{location.buildingNumber}} {{location.secondaryAddress}}',

matthewmayer avatar Apr 28 '23 04:04 matthewmayer

I'm not clear about the '##a', '##b', '##c' patterns. Are the "a", "b", "c" considered part of the secondary address (ie these are room/apartment a, b and c, or are these seperate building numbers?)

matthewmayer avatar Apr 30 '23 10:04 matthewmayer

I cannot answer that for PL but in Germany we use the letters for street numbers if we ran out of digits. E.g. even numbers on the right side, odd on the left. Gradually incrementing from one side of the street to the other. If then one bigger house is demolished and replaced with two or more smaller ones (or houses are build in the second row), then the abc... letters get attached. The secondary address is more like an unofficial way to refer to a thing on that particular address like a building, room, floor but the mail delivery guy can ignore that mostly.

ST-DDT avatar Apr 30 '23 10:04 ST-DDT

Seems to be the case, for example this company is at "1A/2", so building number is 1A.

https://www.emis.com/php/company-profile/PL/Rockpath_Poland_Sp_z_oo_en_4450815.html Ul. Karola Libelta 1A/2 Poznan; Wielkopolskie; Postal Code: 61-706

matthewmayer avatar Apr 30 '23 10:04 matthewmayer

@matthewmayer @ST-DDT I live in Poland and I can answer both of you.

'##a', '##b', '##c' patterns are correct for building numbers in Poland. They are mostly used for residentials where you have one big building with many staircases.

Additionally they are also used in cases like @matthewmayer wrote but mostly they are used for residentials.

Here you have examples: https://www.google.com/maps/place/Murawa+37B,+61-655+Pozna%C5%84/@52.4322919,16.9333746,17z/data=!3m1!4b1!4m6!3m5!1s0x47045ca9a8d34ab9:0x13a2832c369c287a!8m2!3d52.4322919!4d16.9359549!16s%2Fg%2F11csl0hmzv https://www.google.com/maps/place/S%C5%82owia%C5%84ska+33A,+61-664+Pozna%C5%84/@52.430295,16.9257033,17z/data=!3m1!4b1!4m6!3m5!1s0x47045b55f96edc09:0x6f7bf83b4d7ebcc2!8m2!3d52.4302951!4d16.9305796!16s%2Fg%2F11c5n38fv1

Mikilll94 avatar Apr 30 '23 10:04 Mikilll94

In Germany we also have addresses with mutliple street numbers. E.g. Foostraße 101-105 or Foostraße 101/102. I assume that there is a special intention behind that, but I dont know which one.

ST-DDT avatar Apr 30 '23 10:04 ST-DDT

@ST-DDT sure, I'll gladly elaborate with examples:

  • Number + letter #a #b #c ... is a valid pattern. It's usually used where sequential numbers were already used and some new buildings were built in-between. E.g: https://goo.gl/maps/vQBkh997gAcym9ET7
  • In extreme cases where you run out of letters, you just add another, making patterns like 1AB 1AC 1AD valid. E.g: https://goo.gl/maps/WvJqHTsZM31aqQse7
  • @Mikilll94 is right, that addresses like Street 3/4 are sometimes used to indicate flat numbers (building 3, flat 4), but he seems unaware, that they are also used for buildings. Very famous example is a building of Polish Radio: https://goo.gl/maps/CQYs2ALVUGmmFFYRA

While my last PR doesn't cover all numbering conventions, I've added the popular ones that weren't included before. This issue can be closed - #/# and #/#/# are valid building numbers in Poland.

rybaczewa avatar May 05 '23 07:05 rybaczewa

So 3/5/7 can also mean like a big building which has merged the buildings 3, 5 and 7?

But presumably those would normally be in ascending order right?

So 5/3 would be the "building 5 apartment 3" type address instead?

matthewmayer avatar May 05 '23 09:05 matthewmayer

@Mikilll94 is right, that addresses like Street 3/4 are sometimes used to indicate flat numbers (building 3, flat 4), but he > seems unaware, that they are also used for buildings. Very famous example is a building of Polish Radio: > https://goo.gl/maps/CQYs2ALVUGmmFFYRA

This is so rare and uncommon case in Poland that I would remove it from faker because it will just confuse users. Most people when see 4/2 thinks building no. 4 flat no. 2.

Mikilll94 avatar May 05 '23 09:05 Mikilll94

So 3/5/7 can also mean like a big building which has merged the buildings 3, 5 and 7?

But presumably those would normally be in ascending order right?

So 5/3 would be the "building 5 apartment 3" type address instead?

Yes.

In short:

  • 1a 1b 1c - more buildings than originally assumed
  • 3/5/7 - less buildings than originally assumed

Most numbers in this format should be ascending and all even or odd. Not 100% sure on this one, but I think it doesn't matter as much as the #/# format itself.

This is so rare and uncommon case in Poland that I would remove it from faker because it will just confuse users. Most people when see 4/2 thinks building no. 4 flat no. 2.

This is simply untrue, you are projecting your own experiences over facts here man. Pretty much every bigger Polish city is full of them. I don't know what I can tell you:

  • https://goo.gl/maps/GzSEWHWpR3CgUcQu7
  • https://goo.gl/maps/4ByaJfKRfP7aMFLm8
  • https://goo.gl/maps/FLf3tmqTLpxd6jZK9
  • https://goo.gl/maps/N8hFXpu8s1W82CQE7
  • https://goo.gl/maps/ECEnvkbUCfmzdtp69
  • https://goo.gl/maps/Wt1VMrTRjg98jZx29
  • https://goo.gl/maps/MyqmyLRqhzeAsofp9
  • https://goo.gl/maps/eeje6NZEccw7VRxr9
  • https://goo.gl/maps/v2VCtsHHd3KaJRZv6

rybaczewa avatar May 05 '23 10:05 rybaczewa

If I live say say building 14/16, apartment 2, how would you write my address ?

matthewmayer avatar May 05 '23 13:05 matthewmayer

Most common would probably be: Długa 14/16 m. 2 where:

(ul. - street for short /ulica/)
Długa - street name
14/16 - building number
m. - flat for short /mieszkanie/
2 - flat number

Instead of m. there sometimes might be l. / lok. / lokal which is similar to flat/apartment but mostly associated with business, whereas m. / mieszkanie is residential. Ul. is kind of the default, so it's often omitted when writing the address. Prefixes are usually added when other than ul. - like al. / plac / rondo / ...

Side note: Street name isn't required for address, Borki 2 is a valid address (village name + building number)

Also there are city names with single letter (similar to 1a 1b 1c numbering) in names, which makes this a valid address: 3 Maja 76b, Izabelin C

rybaczewa avatar May 05 '23 22:05 rybaczewa