我正在尝试将我的数据从 sql 移动到 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"
}
}
}
有两个例外:
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)];