How to fix duplicate coordinates in Elasticsearch geo shape in java?
<p>I have a geo coordinate and I want to index it to ElastaticSearch. while indexing, i got an error duplicate consecutive coordinates. How to fixed in java?</p>

<p>Coordinate:</p>

<pre><code>[[
    [-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]
]]
</code></pre>

<p>Duplicate coordinate :</p>

<pre><code>    [-87.60000228881836, 41.76849503030295],
    [-87.60000228881836, 41.76849503030295]
</code></pre>

<p>I found a url: <a href="http://davidjairala.github.io/2015/12/02/fix-duplicate-consecutive-coordinates-in-elasticsearch-geo-json-shapes-in-ruby/" rel="nofollow">Fix duplicate consecutive coordinates in Elasticsearch geo json shapes in Ruby</a> </p>

<p>Any one can help to transform to java?</p>