Answer the question
In order to leave comments, you need to log in
How to convert addresses to coordinates?
There is an excel table with addresses in the form:
Shop #1 | Moscow, Nikolskaya, st. Nikolskaya, 17, building 1
Shop #2 | Moscow, shopping center Tramplin, st. Yartsevskaya, 25a
How to convert these addresses into coordinates for Yandex maps (for use with json ObjectManager)?
Or how else can these addresses be used when displaying hundreds of markers on a map?
Answer the question
In order to leave comments, you need to log in
In PHP it goes something like this
$addr = urlencode( $address);
$xml = file_get_contents( "http://geocode-maps.yandex.ru/1.x/?geocode=$addr&results=1" );
// print $xml; Можете посмотреть выдачу
preg_match( '/<pos>([^<]*)<\/pos>/', $xml, $match );
preg_match( '/<precision>([^<]*)<\/precision>/', $xml, $prec );
if ( isset($prec[1]) && isset( $match[1] ) && $prec[1] =='exact' )
return explode( ' ', $match[1] );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question