0

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?

Uffo
  • 9,628
  • 24
  • 90
  • 154

1 Answers1

0

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

Baba
  • 94,024
  • 28
  • 166
  • 217