F
F
Fagotsit2018-09-28 17:27:16
Database
Fagotsit, 2018-09-28 17:27:16

Postcode substitution when entering an address?

Good day to all!
Misters, can who faced and implemented. What to bind the zip code to in the database. The goal is the following, when entering the address (all fields are filled in / selected from the lists: region, city, street, house, apartment), the postal code field was filled in automatically. There is still an unresolved problem, on the same street, different houses can have a different index.
Thank you!
PS If something is not clear, I will add. It seems to me that the question is of interest to many)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
GavriKos, 2018-09-28
@GavriKos

There are actually a lot more assholes out there than you might think. So offhand:
- one house can have DIFFERENT indices (for example, if it has a state organization, it can have a dedicated index)
- it is impossible to uniquely identify the city-street-house link at all - because there are cases when in 1 city there are 2 streets with the same name (or even more). Accordingly - different indexes.
If you answer directly about the database - then the question is on the other hand - how do you fill in the lists of fields? How do you store a list of houses for a city street.
If you answer about the implementation, then:
- add an optional field - "district".
- if the district is not specified - we substitute the city index into the index (the letter will reach anyway - you can do this without specifying the specific index)
- if the district is specified - we get the index of the district
- we give the opportunity to enter your index (for narrow cases)
In any case - mail if something works out.

X
xmoonlight, 2018-09-28
@xmoonlight

Everything is here .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question