Atlas Search: Unable to Tessellate shape

Hi all,

trying to create an atlas search index with following definition:

{
  "mappings": {
    "dynamic": false,
    "fields": {
      "geometry": {
        "indexShapes": true,
        "type": "geo"
      }
    }
  }
}

sadly the index build fails with following error:

Your index could not be built: Unexpected error: Unable to Tessellate shape [[49.47748652086282, -123.79858384565688] [49.47748631290387, -123.79833537632288] [49.47748610439212, -123.79808690974527] [49.47748589536565, -123.79783844040281] [49.477485761488396, -123.79767969655772] [49.47750369510057, -123.79761404608594] [49.47750367636922, -123.79758989051233] [49.47750365585305, -123.79756573214883] [49.477485610071895, -123.79750024279329] [49.477485475730475, -123.79734149894456] [49.4774852650837, -123.79709303235002] [49.4774850539222, -123.79684456299061] [49.477484914050514, -123.79667891676817] [49.47753880850618, -123.7965958535766] [49.47785707753759, -123.79659445750491] [49.47785658451906, -123.7964562714891] [49.47786416290044, -123.79858393595389] [49.47748652086282, -123.79858384565688] ]. Possible malformed shape detected.

The polygon looks like this: problematic_polygon.geojson · GitHub

I know we could try to fix the concrete polygon, but this is quite impossible for size of the dataset like ours - there will be many of such polygons.

Interesting fact is that the collection contains MongoDB geometry_2dsphere index and there is no problem in inserting the polygon into the MongoDB itself.

Maybe this is related to this bug report?

Any idea how to fix / workaround this?

We will release a fix before autumn and I will update this ticket when we do. Thank you for reporting it. I need to test your coordinates to be absolutely sure, but that is my hunch. It can be difficult to eyeball collinearity. I can move it to a spreadsheet, though.

2 Likes

That sounds fantastic, thanks @Marcus!

It can be difficult to eyeball collinearity.

…that’s right, but my guess here is: if you manage to store the polygon in MongoDB collection with the geometry_2dsphere index then the polygon is valid :thinking: