我必须检查mongodb查询的性能。我有两个文件。其中之一包含600个多边形。第二个包含10,000个随机生成的点。两者都位于两个单独的集合中(集合名称:沼泽,tenkpoints)。我想检查多边形中包含哪些点。在mongodb中有可能吗?
多边形(初始片段):
{
"type": "FeatureCollection",
"crs": {
"type": "name",
"properties": {
"name": "urn:ogc:def:crs:OGC:1.3:CRS84"
}
},
"features": [{
"type": "Feature",
"properties": {
"cat": 1.0,
"F_CODEDESC": "Marsh\/Swamp",
"F_CODE": "BH095",
"AREAKM2": 1263.08
},
"geometry": {
"type": "Polygon",
"coordinates": [a lot of coordinates...]
}
}, {
"type": "Feature",
"properties": {
"cat": 3.0,
"F_CODEDESC": "Marsh\/Swamp",
"F_CODE": "BH095",
"AREAKM2": 106.636
},
"geometry": {
"type": "Polygon",
"coordinates": [a lot of coordinates...]
}
点(初始片段):
{
"type": "FeatureCollection",
"crs": {
"type": "name",
"properties": {
"name": "urn:ogc:def:crs:OGC:1.3:CRS84"
}
},
"features": [{
"type": "Feature",
"properties": {
"id": 0
},
"geometry": {
"type": "Point",
"coordinates": [179.983784353492439, 56.255560445919222]
}
}, {
"type": "Feature",
"properties": {
"id": 1
},
"geometry": {
"type": "Point",
"coordinates": [-139.248266199253635, 62.136903403842986]
}
}