Description
I have one document with MultiPoint field. Field has one point inside:
{
|
"_id" : ObjectId("56e7e24cb1b31934cdce1a0e"),
|
"geo_segments" : {
|
"type" : "MultiPoint",
|
"coordinates" : [
|
[
|
42.64248,
|
42.64248
|
]
|
]
|
}
|
}
|
I nserted it like that:
db.test.insert({ "geo_segments" : {
|
"type" : "MultiPoint",
|
"coordinates" : [
|
[
|
42.64248,
|
42.64248
|
]
|
]
|
}})
|
Field is indexed with 2dsphere index:
db.test.ensureIndex({"geo_segments": "2dsphere"})
|
When I run find() with the bounding window (counter clock-wise region:
db.test.find({
|
"geo_segments": {
|
$geoWithin: {
|
$geometry: {
|
type : "Polygon" ,
|
coordinates: [[[-38.0, 40.0], [97.0, 40.0], [97.0, 50.0], [-38.0, 50.0],[-38.0, 40.0]]]
|
}
|
}
|
}
|
})
|
nothing is found.
I have even try it with CRS without result:
db.test.find({
|
"geo_segments": {
|
$geoWithin: {
|
$geometry: {
|
type : "Polygon" ,
|
coordinates: [[[-38.0, 40.0], [97.0, 40.0], [97.0, 50.0], [-38.0, 50.0],[-38.0, 40.0]]],
|
"crs": {
|
type:"name",
|
properties: {
|
name: "urn:x-mongodb:crs:strictwinding:EPSG:4326"
|
}
|
}
|
}
|
}
|
}
|
})
|