ElasticSearch 索引 geo_shape 错误 rMapperParsingException 解析失败

ElasticSearch index geo_shape erro rMapperParsingException failed to parse

我在互联网上找不到解决方案,所以我来了。 我想索引一个包含所有法国多边形的 mysql table 多边形,但我有一些错误,例如这一行:

{"type":"Polygon","coordinates":[[[2.029133,43.436898],[2.05307,43.430308],[2.061392,43.415139],[2.069945,43.407503],[2.067287,43.404781],[2.072801,43.395696],[2.085693,43.398082],[2.091682,43.393886],[2.095111,43.396199],[2.108784,43.39446],[2.111065,43.396188],[2.113814,43.39872],[2.127046,43.399179],[2.133558,43.403558],[2.138318,43.403705],[2.156368,43.414876],[2.170411,43.415813],[2.186802,43.394813],[2.215023,43.382614],[2.229334,43.408268],[2.223356,43.417771],[2.222499,43.428282],[2.239358,43.439747],[2.241345,43.442676],[2.256687,43.453642],[2.258295,43.460113],[2.265415,43.452919],[2.282011,43.441226],[2.299699,43.446812],[2.304118,43.447929],[2.313773,43.44082],[2.348387,43.432774],[2.367332,43.423179],[2.375171,43.423],[2.398735,43.417051],[2.406845,43.419255],[2.404825,43.422438],[2.40776,43.425216],[2.42759,43.434491],[2.451105,43.432228],[2.469545,43.435351],[2.473694,43.436515],[2.494383,43.436937],[2.499039,43.431101],[2.512541,43.428653],[2.518988,43.423715],[2.54805,43.42465],[2.561482,43.420963],[2.565541,43.422914],[2.565787,43.42296],[2.583821,43.412667],[2.593047,43.411712],[2.586888,43.399652],[2.573479,43.399491],[2.569031,43.400247],[2.566312,43.397573],[2.557057,43.389781],[2.552399,43.37642],[2.555239,43.366365],[2.540081,43.345232],[2.551506,43.335844],[2.555536,43.337471],[2.583539,43.333912],[2.592007,43.317985],[2.599712,43.31384],[2.601175,43.298256],[2.617836,43.287682],[2.616957,43.284441],[2.624621,43.287616],[2.631193,43.295933],[2.643911,43.29451],[2.659253,43.292967],[2.65975,43.296333],[2.674858,43.303711],[2.677217,43.313613],[2.685553,43.316579],[2.687773,43.323],[2.697158,43.316757],[2.699148,43.308333],[2.705513,43.292266],[2.700304,43.282816],[2.702969,43.276823],[2.70892,43.273655],[2.717737,43.275558],[2.740772,43.264578],[2.752521,43.254594],[2.772493,43.258029],[2.779998,43.265241],[2.78708,43.274035],[2.786968,43.274439],[2.787239,43.28769],[2.801826,43.300312],[2.809681,43.304374],[2.816603,43.30865],[2.80611,43.31921],[2.818156,43.323963],[2.837394,43.322429],[2.845974,43.325617],[2.868539,43.330063],[2.873743,43.339632],[2.869575,43.356451],[2.855625,43.37348],[2.86918,43.383636],[2.870568,43.381011],[2.872289,43.372934],[2.887716,43.3666],[2.889904,43.357346],[2.889495,43.351767],[2.891178,43.341802],[2.885119,43.333249],[2.894929,43.32626],[2.910982,43.32005],[2.921249,43.326085],[2.946079,43.311959],[2.957536,43.312476],[2.990722,43.319223],[3.004423,43.319709],[3.006282,43.300133],[3.005738,43.286244],[3.012104,43.280936],[3.011118,43.277617],[3.015032,43.275817],[3.026842,43.281159],[3.054346,43.280041],[3.076978,43.262928],[3.086198,43.26382],[3.097452,43.257928],[3.11017,43.253903],[3.114663,43.254745],[3.118897,43.260731],[3.141628,43.259507],[3.147017,43.254157],[3.146507,43.247383],[3.159183,43.243228],[3.173126,43.243836],[3.184023,43.250124],[3.193229,43.250404],[3.201526,43.247763],[3.228989,43.219158],[3.240561,43.212809],[3.183535,43.170042],[3.182093,43.170097],[3.174276,43.177265],[3.183117,43.169159],[3.175006,43.16309],[3.154964,43.14352],[3.150845,43.138824],[3.133507,43.14584],[3.148871,43.139623],[3.148739,43.139334],[3.131174,43.111474],[3.117663,43.102198],[3.084479,43.056162],[3.06484,43.019814],[3.067308,43.013229],[3.05581,42.998073],[3.042844,42.960163],[3.03975,42.932034],[3.055053,42.924095],[3.05993,42.917987],[3.043511,42.83815],[3.012576,42.852366],[2.9889,42.864605],[2.976601,42.870151],[2.917116,42.88486],[2.906997,42.895679],[2.884216,42.899272],[2.865274,42.918341],[2.83792,42.912314],[2.810132,42.89842],[2.787164,42.894411],[2.761908,42.873325],[2.754346,42.851707],[2.744132,42.84012],[2.72743,42.834405],[2.682011,42.830719],[2.665142,42.836656],[2.664347,42.836752],[2.638411,42.834088],[2.600079,42.836595],[2.572402,42.843367],[2.558603,42.845506],[2.518539,42.843139],[2.515232,42.845454],[2.508779,42.849812],[2.500451,42.850431],[2.462198,42.838556],[2.45682,42.837477],[2.401354,42.843872],[2.382168,42.848466],[2.370849,42.84635],[2.336097,42.840709],[2.32504,42.835199],[2.321925,42.825773],[2.33168,42.818857],[2.334922,42.802331],[2.343922,42.801227],[2.344229,42.780565],[2.343325,42.774112],[2.352367,42.763395],[2.350519,42.757296],[2.352471,42.749692],[2.353569,42.748566],[2.357134,42.738418],[2.355346,42.728049],[2.342892,42.722902],[2.32249,42.708109],[2.28859,42.70067],[2.275384,42.702928],[2.264713,42.709032],[2.264471,42.702116],[2.256682,42.698268],[2.244451,42.67983],[2.218667,42.672425],[2.192168,42.659056],[2.192367,42.651766],[2.176219,42.648901],[2.176143,42.652596],[2.176089,42.653009],[2.166054,42.663918],[2.166748,42.670793],[2.175522,42.682747],[2.170398,42.692491],[2.161494,42.700523],[2.147599,42.70124],[2.140607,42.705824],[2.139465,42.71218],[2.113806,42.724497],[2.100535,42.731715],[2.089554,42.736657],[2.08636,42.752069],[2.084951,42.751661],[2.05812,42.755484],[2.043915,42.74741],[2.034932,42.746826],[2.030775,42.741483],[2.019979,42.740018],[2.003781,42.733529],[1.998506,42.735943],[1.991439,42.734799],[1.950256,42.737658],[1.943623,42.746206],[1.931555,42.750934],[1.929817,42.755206],[1.912999,42.759309],[1.908994,42.765248],[1.90952,42.768436],[1.92231,42.770445],[1.92896,42.774603],[1.901467,42.800637],[1.898386,42.802701],[1.89557,42.808931],[1.869656,42.814992],[1.859379,42.820809],[1.860178,42.827428],[1.875571,42.839497],[1.875018,42.84594],[1.875897,42.852324],[1.889041,42.852704],[1.947125,42.85669],[1.960244,42.861376],[1.98504,42.870859],[1.981921,42.877197],[1.989328,42.910488],[1.980575,42.92958],[1.933732,42.939144],[1.936138,42.952056],[1.952121,42.955891],[1.951304,42.959095],[1.96166,42.962011],[1.979382,42.960507],[1.988592,42.953381],[1.997126,42.954072],[2.004908,42.961564],[1.991636,42.963473],[1.985929,42.968466],[1.983436,42.988418],[1.987127,42.994506],[1.985145,43.003482],[1.969256,43.007944],[1.985468,43.023478],[1.985759,43.029957],[1.979453,43.037903],[1.975929,43.042303],[1.961083,43.049564],[1.954081,43.04678],[1.945866,43.049398],[1.940394,43.061586],[1.944221,43.066948],[1.961181,43.0667],[1.963079,43.069587],[1.956905,43.077974],[1.949782,43.081692],[1.955776,43.085447],[1.950633,43.102388],[1.951491,43.11131],[1.945064,43.122357],[1.927999,43.124185],[1.927408,43.129495],[1.916269,43.133432],[1.904424,43.131163],[1.892668,43.117126],[1.890102,43.123469],[1.880597,43.130549],[1.880648,43.147541],[1.87449,43.142648],[1.856847,43.14463],[1.85196,43.160607],[1.845774,43.15653],[1.848366,43.147345],[1.826188,43.145685],[1.82144,43.148998],[1.801198,43.157014],[1.783561,43.154325],[1.779464,43.16036],[1.754844,43.170928],[1.739608,43.184298],[1.725888,43.187682],[1.71178,43.18684],[1.709632,43.190008],[1.710038,43.1999],[1.724627,43.212496],[1.720838,43.221969],[1.723908,43.224435],[1.716082,43.228372],[1.70028,43.24551],[1.701035,43.259015],[1.688419,43.273553],[1.696748,43.276048],[1.701275,43.281698],[1.706645,43.286036],[1.714527,43.297097],[1.704014,43.30282],[1.727503,43.313571],[1.735952,43.316018],[1.724413,43.329666],[1.726379,43.332694],[1.728109,43.335873],[1.722904,43.341533],[1.735426,43.337704],[1.746554,43.343484],[1.749224,43.349461],[1.772272,43.336976],[1.77653,43.342558],[1.784931,43.345154],[1.796973,43.340565],[1.813484,43.341503],[1.815676,43.348149],[1.805041,43.359278],[1.804068,43.376452],[1.808891,43.38239],[1.80453,43.391609],[1.826108,43.394661],[1.821619,43.398787],[1.8165,43.404148],[1.817266,43.410652],[1.82676,43.417746],[1.840383,43.416741],[1.844511,43.422607],[1.846824,43.427913],[1.842953,43.43255],[1.856453,43.443455],[1.872942,43.43696],[1.873987,43.43026],[1.897627,43.414271],[1.902115,43.408702],[1.895584,43.39658],[1.903592,43.394025],[1.910708,43.397398],[1.91463,43.400749],[1.911255,43.403054],[1.920297,43.414419],[1.921211,43.420978],[1.934526,43.423818],[1.947537,43.4204],[1.958169,43.425613],[1.963752,43.422752],[1.965924,43.415188],[1.97269,43.419202],[1.990858,43.409386],[2.012605,43.415029],[2.02092,43.423194],[2.028794,43.41962],[2.037293,43.42218],[2.038411,43.425482],[2.029133,43.436898]]]}

我有这个错误:

index: /my_index/polygones/11 caused MapperParsingException[failed to parse [polygoneDefElastica]]; nested: InvalidShapeException[Self-intersection at or near point (3.182093989343098, 43.170096962265, NaN)]; 

我不知道这个点(3.182093989343098, 43.170096962265)是怎么产生的,但我认为它对应于我的多边形坐标中的这个点[3.182093,43.170097]。

谢谢你:)

它们似乎确实在东海岸的两点自相交。如果您从多边形中删除点 [3.182093,43.170097][3.148871,43.139623],它的索引没有任何问题。如果您一直放大 http://geojsonlint.com/ 中的这些点,您会看到这些点如何与线交叉一点点。

谢谢你,imotov。我找到了解决方案,我使用 http://mapshaper.org/ 来解决问题。