So this is what i`ve come up with. Hope it helps out someone.
First I selected some destinations where the difference between coordinates is smaller than 0.25. You can adjust this value as needed. My cypher query looks like this:
START n = node:Destination('*:*')
WHERE has( n.lat ) AND has( n.long ) AND ABS(n.lat - ".$value['place']['location']['latitude'].") < 0.25 AND ABS(n.long - ".$value['place']['location']['longitude'].") < 0.25
RETURN n, ABS(n.lat - ".$value['place']['location']['latitude']."), ABS(n.long - ".$value['place']['location']['longitude'].")
Then i caclulate "Levenshtein distance" (the minimal number of characters you have to replace, insert or delete to transform str1 into str2.) with levenshtein() function and select only those those that have this value smaller than length of string / 2. This value also can be adjusted for your needs. And heres the code:
foreach( $nodes as $key2 => $value2 ){
$name1 = strtolower($value2['x']->getProperty('name'));
$name2 = strtolower($value['place']['name']);
$name2 = explode( ",", $name2 );
$name2 = $name2[0];
$similarity = levenshtein($name1, $name2);
if( abs($similarity) <= intval(strlen($name1)/2) ){
array_push($similarityArray,$value2);
}
}
After this i narrowed it down by selecting the locations that was the nearest simply like this:
$minDifference = 0.4;
foreach( $similarityArray as $key2 => $value2 ){
if( $minDifference > ($value2[1]+$value2[2]) ){
$minDifference = ($value2[1]+$value2[2]);
$minKey = $key2;
}
}
The location will most probably be the one with the key $minKey.