0
我想將我的數據從sql移動到elasticsearch。 我每次嘗試添加多邊形時都有例外。不能將地理形狀插入elasticsearch
我使用WktReader讀取WKT並將其添加到JeoJson類中。 該類包含類型(多邊形)和座標
座標建立(在C#):
{ [ [ [ x,y ], [ x,y ], [ x,y ], [ x,y ], [ x,y ] ] ] }
在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"
}
}
}
有兩個例外:
MapperParsingException[failed to parse [GEOMETRIES.SHAPE]]; nested: IllegalArgumentException[Invalid number of points in LinearRing (found 3 - must be 0 or >= 4)];
MapperParsingException[failed to parse [GEOMETRIES.SHAPE]]; nested: InvalidShapeException[provided shape has duplicate consecutive coordinates at: (number, number, NaN)];