0
votes

I have the same issue than Unable to Tessellate shape error on indexing for valid geo shape using ElasticSearch 7.11.1 (having Lucene 8.7.0 dependency).

My geometry, in WKT format is

POLYGON((-180 62.288856810085, -178.761 63.4792, -180 63.7639, -180 63.763900213475,-180 62.288856810085))

and indexing it, returned error is

Unable to Tessellate shape [[62.288856810085, -180.0] [63.7639, -180.0] [63.763900213475, -180.0] [62.288856810085, -180.0] ]. Possible malformed shape detected.

I suppose error is caused by points with latitude values 63.7639 and 63.763900213475 having the same longitued value -180.0.

Anyway... is there any workaround?

1

1 Answers

0
votes

I had the same problem and I found that is about the so-called "right-hand rule" described here: https://www.rfc-editor.org/rfc/rfc7946#section-3.1.6

A linear ring MUST follow the right-hand rule with respect to the area it bounds, i.e., exterior rings are counterclockwise, and holes are clockwise.

If you do not follow this rule, Elastic Search does not interpret correctly the geometry and "shuffles" your coordinates generating a self-intersecting polygon.

I solved this issue using geojson-rewind to order correctly the geometry points before indexing in ES.