I’m trying to query document inside a very large polygon that almost goes around the world. It is not a “big polygon” as described in the doc though. Unfortunately the app I’m using to build this polygon create a GeoJSON that does not follow the right-hand rule from the GeoJSON RFC ( saying that this polygon should be built counter-clockwise). Hence, the query return a document inside the polygon assuming it has been built clockwise which seems fair. First playground; Mongo playground
However, the behaviour I don’t understand is that when I’m making the same query with a smaller polygon built clockwise like the previous one, the document located in France is returned. I would have expected the query to be performed against the counter-clockwise polygon as before. Second playground:
Could someone explain this behaviour and what rule MongoDB follows choosing to perform $geowithin query against counter-clockwise or clockwise polygons?