So let's say I this type of data:
'Latitude' => string '45.798889' (length=9)
'Longitude' => string '21.500833' (length=9)
Now I want to find some cities near this location is this possible?
So let's say I this type of data:
'Latitude' => string '45.798889' (length=9)
'Longitude' => string '21.500833' (length=9)
Now I want to find some cities near this location is this possible?
No need for anything complex in PHP
use Geospatial Indexing
is pretty easy to use
$col->find(array('loc'=>array('$near'=>array(45.798889, 21.500833))));
Other option include $geoWithin
, $geoIntersects
, $nearSphere
etc