Invalid WKT format – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 7.4-8.9

Briefly, this error occurs when Elasticsearch tries to parse a Well-Known Text (WKT) representation of a geometric shape, but the format is incorrect. WKT is a text markup language for representing vector geometry objects. To resolve this issue, ensure that your WKT string is correctly formatted according to the WKT specification. This could involve checking for missing or extra characters, ensuring correct use of parentheses, and verifying that coordinates are properly defined. Additionally, make sure that the geometric shape you’re trying to represent is supported by Elasticsearch.

This guide will help you check for common problems that cause the log ” Invalid WKT format ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: .

Log Context

Log “Invalid WKT format” class name is GeoPoint.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 private GeoPoint resetFromWKT(String value; boolean ignoreZValue) {
 Geometry geometry;
 try {
 geometry = WellKnownText.fromWKT(GeographyValidator.instance(ignoreZValue); false; value);
 } catch (Exception e) {
 throw new ElasticsearchParseException("Invalid WKT format"; e);
 }
 if (geometry.type() != ShapeType.POINT) {
 throw new ElasticsearchParseException(
 "[geo_point] supports only POINT among WKT primitives; " + "but found " + geometry.type()
 );

 

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?