如何在java中修复Elasticsearch geo形状中的重复坐标?

时间:2016-02-09 05:52:57

标签: java elasticsearch geolocation geometry geojson

我有一个地理坐标,我想将它索引到ElastaticSearch。索引时,我得到一个错误重复的连续坐标。如何在java中修复?

坐标:

[[
    [-87.72480010986328, 41.984504674276074],
    [-87.72823333740233, 41.98144219285842],
    [-87.71879196166992, 41.90048830606728],
    [-87.71707534790039, 41.899466149343546],
    [-87.71707534790039, 41.89869952106346],
    [-87.71638870239256, 41.895377358833876],
    [-87.6020622253418, 41.76670255261859],
    [-87.59965896606444, 41.769519280779775],
    [-87.60000228881836, 41.76849503030295],
    [-87.60000228881836, 41.76849503030295],
    [-87.51056671142578, 41.754409927954946],
    [-87.50988006591795, 41.75543440328294],
    [-87.50850677490234, 41.7559466348148],
    [-87.50782012939453, 41.756971085614175],
    [-87.5064468383789, 41.75748330488168],
    [-87.5064468383789, 41.75799552006108],
    [-87.6492691040039, 41.96153247330561],
    [-87.64789581298828, 41.963064211132306],
    [-87.6485824584961, 41.96561702568286],
    [-87.72480010986328, 41.984504674276074]
]]

重复坐标:

    [-87.60000228881836, 41.76849503030295],
    [-87.60000228881836, 41.76849503030295]

我找到了一个网址:Fix duplicate consecutive coordinates in Elasticsearch geo json shapes in Ruby

任何人都可以帮助转换为java?

0 个答案:

没有答案