问题,尝试索引并收到以下错误:
"多边形的外壳无效"
但是,我已在http://geojsonlint.com/上测试了JSON并且它可以正常运行
这是我的JSON
{
"type": "Polygon",
"coordinates": [
[
[
116.306655,
39.984977
],
[
116.30673,
39.984977
],
[
116.306734,
39.98483
],
[
116.30667,
39.98483
],
[
116.306678,
39.984714
],
[
116.306384,
39.984705
],
[
116.30638,
39.984858
],
[
116.306193,
39.984852
],
[
116.306198,
39.984601
],
[
116.306031,
39.984597
],
[
116.306031,
39.984596
],
[
116.306031,
39.984596
],
[
116.306023,
39.984961
],
[
116.306082,
39.984964
],
[
116.306082,
39.985019
],
[
116.306655,
39.985032
],
[
116.306655,
39.984977
]
]
]
}
答案 0 :(得分:1)
你在运行什么版本的mongodb。如果您运行的是2.4,请尝试升级到2.6。我有与人口普查老虎行数据相同的错误消息,我已经转换为GeoJSON,我也通过jsonlint确认。我一直在2.4版本上运行索引。我升级到mongodb 2.6版,这解决了我的问题。我能够创建一个2dsphere索引并在此之后运行geonear查询。