我想检索边界框内的数据((ra_min,dec_min),(ra_max,dec_max))。谁能告诉我下面有什么问题?
php 代码和数据结构如下。谢谢......
结构 :
{
"filter": "E",
"loc": {
"dec": 130,
"ra": 15
},
"path": "00015+00130E.jpeg"
},
{
"filter": "Z",
"loc": {
"dec": 130,
"ra": 15
},
"path": "00015+00130Z.jpeg"
},
代码 :
$lowerLeft = array("ra"=>$RA_min - $ra_offset, "dec"=>$DEC_min - $dec_offset);
$upperRight= array("ra"=>$RA_max + $ra_offset, "dec"=>$DEC_max + $dec_offset);
$cond = array("loc" => array('$within' => array('$box' => $lowerLeft, $upperRight)));
$cursor = $collection->find($cond);