Mongo geojson导入带圆角坐标的结果

时间:2016-06-17 08:49:02

标签: mongodb geojson mongoimport

我有下一个geojson:

{
    "type": "Feature",
    "geometry": {
        "type": "Point",
        "coordinates": [-80.87088507656375, 35.21515162500578]
    },
    "properties": {
        "name": "ABBOTT NEIGHBORHOOD PARK",
        "address": "1300  SPRUCE ST"
    }
}

当我运行mongo import时,没有任何错误,但我的所有坐标都是圆角的,它看起来像:

{
  "_id":"5763b765e79b559e5815ba46",
  "type":"Feature",
  "geometry":{
    "type":"Point",
    "coordinates":[
      -81,
      35.22
    ]
  },
  "properties":{
    "name":"ABBOTT NEIGHBORHOOD PARK",
    "address":"1300  SPRUCE ST"
  }
}

您是否知道为什么会这样,以及可以采取哪些措施来解决这个问题?感谢。

1 个答案:

答案 0 :(得分:0)

jsonfile image

  

这是你导入josn后的Json文件

Chetan-desktop:~/Desktop$ mongoimport --db stackoverflow --collection exp2 --file stackoverflow.json
2016-06-18T10:32:40.587+0530    connected to: localhost
2016-06-18T10:32:40.831+0530    imported 1 document
  

导入输出后就像那样

> use stackoverflow
switched to db stackoverflow
> show collections
exp2
stack1
system.indexes
> db.exp2.find().pretty()
{
    "_id" : ObjectId("5764d5f018787c4414e189e2"),
    "type" : "Feature",
    "geometry" : {
        "type" : "Point",
        "coordinates" : [
            -80.87088507656375,
            35.21515162500578
        ]
    },
    "properties" : {
        "name" : "ABBOTT NEIGHBORHOOD PARK",
        "address" : "1300  SPRUCE ST"
    }
}
  

我没有找到任何圆角的坐标

     

可能是因为我的MongoDB shell版本检查你的mongo版本:   3.2.6