使用mongoose将可查询的GeoJson存储在mongoDB中

时间:2016-04-13 02:39:25

标签: javascript node.js mongodb mongoose

所以我试图能够在我的数据库中查询大型GeoJson文件的指定部分。原始文件的格式如下:

dealloc

我当前的Mongoose Schema是一个嵌套模式,如下所示: GeoJson.model.js

viewDidDisappear

和Feature.model.js

{
    "type": "FeatureCollection",
    "features": [{
            "type": "Feature",
            "properties": {
                "GEO_ID": "xxxxdhuxxx",
                "STATE": "01",
                "COUNTY": "029",
                "NAME": "Cleburne",
                "LSAD": "County",
                "CENSUSAREA": 560.100000
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [-85.388717, 33.913044],
                        [-85.380885, 33.873508]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "properties": {
                "GEO_ID": "xxxxuiuyxxx",
                "STATE": "01",
                "COUNTY": "031",
                "NAME": "Coffee",
                "LSAD": "County",
                "CENSUSAREA": 678.972000
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [-86.030441, 31.618939],
                        [-86.004085, 31.619067],
                        [-85.999948, 31.619311],
                        [-85.980098, 31.619189],
                        [-85.926702, 31.618966],
                        [-86.030441, 31.618939]
                    ]
                ]
            }
        }
    ]
}

我继续获得验证错误因此出了问题,但我无法发现它。有什么想法吗?

0 个答案:

没有答案