Answer the question
In order to leave comments, you need to log in
How to get city area by coordinates via API?
For example, the city of Ufa has a Soviet district, and it is found through the search, and its polygon is highlighted.
We have, for example, the coordinates of a point in this area: [ 54.73554432816171, 55.98554909014894 ].
Calling these geocode methods ( res_geo.getAddressLine(), res_geo.getLocalities(), res_geo.getThoroughfare(), res_geo.getPremise(), res_geo.getAdministrativeAreas() ) will give the following values, respectively:
Russia, Republic of Bashkortostan, Ufa, street 8 Marta, 32/1 ["Ufa"] street 8 March undefined (2) ["Republic of Bashkortostan", "urban district of Ufa"]
At the same time, there is no city district, and, judging by the api, there are no methods left to get it. Sometimes it shows the neighborhood, but that's not what I need. API version 2.1.
PS, I came across dimik's links.
1. jsfiddle.net/rL7bztfw
2. jsfiddle.net/rL7bztfw/1
1 - no specification, defines the region, 2 - with specification, does not define. (but there are other coordinates, in 1 case it is a circle, a road, without a specific address)
I tried it myself without clarification, with a clarification of locality - there is no area. With the refinement district - shows the microdistrict .
.properties.get( ' metaDataProperty') .getAll() doesn't have soviet area either
Answer the question
In order to leave comments, you need to log in
https://tech.yandex.ru/maps/doc/geocoder/desc/conc...
The Yandex Maps geocoder gives you the data you need upon request with the parameter kind=district
house — house;
street - street;
metro - metro station;
district - district of the city;
locality — locality (city/town/village/village/...).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question