Unable to Tessellate shape

when i ingest geo_shape data to ES, it shows this kind of error

elasticsearch.helpers.errors.BulkIndexError: ('1 document(s) failed to index.', [{'index': {'_index': 'spx_id_station_zone_detail_di_test', '_type': '_doc', '_id': '9JJ7aX0BQngx9kf3pRMQ', 'status': 400, 'error': {'type': 'mapper_parsing_exception', 'reason': 'failed to parse field [detail] of type [geo_shape]', 'caused_by': {'type': 'illegal_argument_exception', 'reason': 'Unable to Tessellate shape [[-1.6207622, 103.5866089] [-1.6207252, 103.5869598] [-1.6207438, 103.5873489] [-1.6207622, 103.5876617] [-1.6207091, 103.5878754]

The original detail is

{"type": "Polygon", "coordinates": [[[103.5858994, -1.6208161], [103.5854721, -1.6207808], [103.5851669, -1.6207218], [103.5848541, -1.6207311], [103.5840073, -1.6205026], [103.5835876, -1.6203928], [103.58255, -1.6200943], [103.5818024, -1.6198857], [103.581543, -1.6198164], [103.5809708, -1.6196495], [103.5803757, -1.619464], [103.579689, -1.6192415], [103.5794067, -1.6191673], [103.5790558, -1.6191303], [103.5788345, -1.6191487], [103.5786285, -1.6191858], [103.5783691, -1.6192601], [103.578064, -1.6193657], [103.5774307, -1.6195586], [103.5767746, -1.6197367], [103.57621, -1.6198999], [103.5757828, -1.619997], [103.5752792, -1.620433], [103.5750427, -1.620658], [103.5749664, -1.6207281], [103.5745621, -1.6211817], [103.574295, -1.6213518], [103.5739975, -1.621412], [103.5736542, -1.6213983], [103.5732727, -1.6212437], [103.5727158, -1.6208405], [103.5721664, -1.6203972], [103.5713272, -1.6195576], [103.5707626, -1.6190673], [103.5701752, -1.6184561], [103.568573, -1.6171354], [103.567543, -1.6162461], [103.5671997, -1.6160311], [103.566803, -1.6158563], [103.5664444, -1.615809], [103.5660019, -1.6158422], [103.5658035, -1.6160367], [103.5656967, -1.6159552], [103.5656204, -1.6157382], [103.5656052, -1.6154848], [103.5655365, -1.6149238], [103.5655518, -1.6133113], [103.5656891, -1.6133696], [103.5659332, -1.6135453], [103.566185, -1.6138467], [103.566391, -1.6139722], [103.5666122, -1.6140977], [103.5668411, -1.6141982], [103.567215, -1.6140726], [103.5675659, -1.6140977], [103.5678482, -1.6140977], [103.5680466, -1.6141479], [103.5682983, -1.6142734], [103.5684509, -1.6143488], [103.5685501, -1.6143237], [103.5686951, -1.6142484], [103.5689774, -1.6141229], [103.5692291, -1.6140726], [103.5695496, -1.6139973], [103.5696793, -1.6137965], [103.5698013, -1.6135956], [103.5698853, -1.6133111], [103.5700531, -1.6129177], [103.5701523, -1.612767], [103.5703278, -1.6126916], [103.5705566, -1.6126163], [103.5707092, -1.6124908], [103.570755, -1.6122899], [103.5707855, -1.6118128], [103.5707321, -1.6115366], [103.5706787, -1.6112856], [103.5708313, -1.6110595], [103.5711365, -1.6109089], [103.5715332, -1.6107332], [103.5718842, -1.610549], [103.5717773, -1.610307], [103.5716248, -1.609903], [103.5715866, -1.609694], [103.5715485, -1.609466], [103.5715256, -1.609165], [103.5715256, -1.6089612], [103.5719147, -1.6086602], [103.5724106, -1.6086074], [103.572731, -1.6085279], [103.5731125, -1.6084485], [103.5740662, -1.6083091], [103.5742035, -1.6082898], [103.5748596, -1.6084054], [103.5749588, -1.6084232], [103.5752945, -1.6084943], [103.5757599, -1.6087073], [103.5761795, -1.6089734], [103.5765381, -1.6092482], [103.5769043, -1.6094532], [103.5772247, -1.6095188], [103.5777054, -1.6096309], [103.5779495, -1.6096897], [103.5782013, -1.6097083], [103.5784836, -1.60974], [103.5793304, -1.6106962], [103.5797729, -1.611873], [103.5799408, -1.6127037], [103.5801163, -1.613036], [103.5805588, -1.6141437], [103.580719, -1.6144068], [103.580925, -1.6147531], [103.5812988, -1.6146291], [103.5815125, -1.6145307], [103.5818787, -1.6144463], [103.5819702, -1.614388], [103.5821991, -1.6142354], [103.5825272, -1.6139119], [103.5827484, -1.6136446], [103.5828781, -1.6135364], [103.5829468, -1.6134758], [103.5830841, -1.6133492], [103.5831604, -1.6133211], [103.5835266, -1.6136305], [103.5836258, -1.6137506], [103.5841293, -1.6142917], [103.5845032, -1.6146375], [103.5848007, -1.6149949], [103.5851288, -1.6152481], [103.585434, -1.6153747], [103.5857849, -1.6155576], [103.5861359, -1.6158248], [103.5863972, -1.6160414], [103.5860327, -1.6165489], [103.5871374, -1.6169582], [103.5869141, -1.6171629], [103.5867768, -1.6173376], [103.5867582, -1.6173571], [103.5866352, -1.617532], [103.5865795, -1.6177403], [103.5865804, -1.6177408], [103.5865707, -1.6177614], [103.5870361, -1.6179755], [103.5873813, -1.6181251], [103.5874143, -1.618141], [103.5878205, -1.6186243], [103.5878318, -1.619349], [103.5878319, -1.6193508], [103.5878372, -1.6197445], [103.5878474, -1.6198677], [103.5878725, -1.6207021], [103.5878726, -1.6207098], [103.5878754, -1.620709], [103.5878754, -1.6207091], [103.5876617, -1.6207622], [103.5873489, -1.6207438], [103.5869598, -1.6207252], [103.5866089, -1.6207622], [103.5858994, -1.6208161]]]}

When showing in geojson.io, it looks pretty good.

I don't know why......

We are working on improving the feedback in these cases. The problem is that your Polygon has a self-intersection at lat=-1.6207097957553944, lon=103.58787259994486.

2 Likes

Wow, thanks. BTW, how do you find this point? Is there any method to fix it?

I just merged this change in Lucene that provides that information:

https://issues.apache.org/jira/browse/LUCENE-9538

Elasticsearch does not have the functionality to correct those kind of polygons at the moment.

Thanks.
We solved this issue in google map by formatting it in advance.

tatenda

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.