K
K
Konstantin B.2018-08-26 13:37:41
Yandex maps
Konstantin B., 2018-08-26 13:37:41

How to use KLADR or Yandex API correctly for division into regions?

Hello, dear Toasterites :)
Companies from different cities and towns can register on the site, I decided to attach some assistant to it for convenience, but I didn’t have any experience with any of the systems, or rather, I didn’t, I used it, but it’s just the entered address was saved in the form of text and that's it.
But then you need to then display these companies depending on the selected city or region. That is, if a large city is specified, then all companies in this city will be displayed, if the region is specified, then all companies in the region.
And how to connect all this with the companies on the site, what identifiers to store, so that later it would not be difficult to choose?
What tables need to be created and what fields in them?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Alekseev, 2018-08-27
@Zatmil

The easiest option is to make a separate table with addresses and store them there, at least as a structured string. Also make a separate table with links of addresses to organizations. When searching, check the occurrence of a city, region, or anything else in the address line and then already issue a list of organizations.
I will explain why a separate table of addresses. An organization can have > 1 address (legal and actual, for example), even if this is not the case now, it is better to foresee it in advance.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question