I am trying to move my data from sql to elasticsearch. I have an exception every time i try adding a polygon shape.
I use WktReader to read the WKT and add it in a JeoJson class. The class contains type (polygon) and coordinates
coordinates build (in c#):
{ [ [ [ x,y ], [ x,y ], [ x,y ], [ x,y ], [ x,y ] ] ] }
GEOMETRIES mapping in elasticsearch:
"GEOMETRIES" : {
"type" : "nested",
"properties" : {
"AREA" : { "type" : "double" },
"CENTROID" : {
"type" : "geo_point",
"geohash" : true,
"geohash_preflix" : true
},
"KEY" : {
"type" : "string",
"index" : "not_analyzed"
},
"SHAPE" : {
"type" : "geo_shape"
}
}
}
There are two exceptions:
1
MapperParsingException[failed to parse [GEOMETRIES.SHAPE]]; nested: IllegalArgumentException[Invalid number of points in LinearRing (found 3 - must be 0 or >= 4)];
2
MapperParsingException[failed to parse [GEOMETRIES.SHAPE]]; nested: InvalidShapeException[provided shape has duplicate consecutive coordinates at: (number, number, NaN)];