根据lat和long找到附近的城市

时间:2013-05-29 16:02:48

标签: php geolocation geo

所以我想说这类数据:

  'Latitude' => string '45.798889' (length=9)
  'Longitude' => string '21.500833' (length=9)

现在我想找到这个位置附近的一些城市吗?

1 个答案:

答案 0 :(得分:0)

PHP使用Geospatial Indexing中的任何内容都不需要使用

$col->find(array('loc'=>array('$near'=>array(45.798889, 21.500833))));

其他选项包括$geoWithin$geoIntersects$nearSphere

相关问题