在MongoDB上得到以下错误。
error MongoError: longitude/latitude is out of bounds, lng: 180 lat: 68.9636
...
operationTime: Timestamp { _bsontype: 'Timestamp', low_: 1, high_: 1590391393 },
ok: 0,
errmsg: 'longitude/latitude is out of bounds, lng: 180 lat: 68.9636',
code: 2,
codeName: 'BadValue',
'$clusterTime': {
clusterTime: Timestamp { _bsontype: 'Timestamp', low_: 1, high_: 1590391393 },
signature: { hash: [Binary], keyId: 0 }
},
name: 'MongoError',
[Symbol(mongoErrorContextSymbol)]: {}
然而,边界应该是有效的。
如果指定经纬度坐标,请先列出经度,再列出纬度。
有效的经度值是在-180和180之间,两者都包含在内。有效的纬度值在-90和90之间,两者都包含在内。
https:/docs.mongodb.commanualreferencegeojson)。
作为参考,我的查询是
Profiles.find(
{
'features.geometry': {
$geoIntersects: {
$geometry: geometry
}
}
}
).fetch()
(使用Meteor)
该 geometry
甚至可以显示。https:/gist.github.comoleg13119b17e25670d6a54a176a5c670fd9ce5。
有谁见过这种看似有效的坐标的错误吗?
原来有些地物的经度 稍微 高于180,在错误回溯中显示时被四舍五入到180。