我已经开发了python函数,通过集合查找所有元素到mongodb,这是我的代码
def get_all_beacon():
beacon = mongo.db.beacon_ss
output = []
for s in beacon.find():
output.append({'Lon' : s['x'], 'Lat' : s['y']})
return jsonify({'result' : output})
但是当我有json collection
的简单结构时,我会使用此代码。
现在我将这个json
结构集成到集合中:
{
"type":"FeatureCollection",
"features":[
{
"type":"Feature",
"properties":{
"Id":0,
"IDENTIFICA":"981"
},
"geometry":{
"type":"Point",
"coordinates":[
12.495219988267976,
41.86792598901761
]
}
},
{
"type":"Feature",
"properties":{
"Id":0,
"IDENTIFICA":"983"
},
"geometry":{
"type":"Point",
"coordinates":[
12.495215710032879,
41.86785696880555
]
}
}]}
在这种情况下我怎么能取坐标值? 感谢