# Invalid LinearRing provided for type polygon. Linear ring must be an array of coordinates

**URL:** <https://discuss.elastic.co/t/invalid-linearring-provided-for-type-polygon-linear-ring-must-be-an-array-of-coordinates/208428>\
**Category:** Elasticsearch\
**Created:** [November 19, 2019, 5:22am UTC](https://discuss.elastic.co/t/invalid-linearring-provided-for-type-polygon-linear-ring-must-be-an-array-of-coordinates/208428 "2019-11-19T05:22:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ohoroyoi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ohoroyoi/32/46820_2.png) [@ohoroyoi](https://discuss.elastic.co/u/ohoroyoi)\
**Post date:** [November 19, 2019, 5:22am UTC](https://discuss.elastic.co/t/invalid-linearring-provided-for-type-polygon-linear-ring-must-be-an-array-of-coordinates/208428/1 "2019-11-19T05:22:52Z")

</div>

version 6.7.2

```
{
"properties": {
  "boundaries": {
    "type": "geo_shape",
    "ignore_malformed":true
  }
}

```

}

but ignore\_malformed doesn't work.

I can't get documents using this query(below).

```auto
{
    "query":{
        "bool": {
            "must": {
                "match_all": {}
            },
            "filter": {
                "geo_shape": {
                    "boundaries": {
                        "shape": {
                            "type": "Polygon",
                            "coordinates" : [82.230177, 52.045447]
                        },
                        "relation": "contains"
                    }
                }
            }
        }
    }
}

```

it returns this.

```auto
"type": "parse_exception",

"reason": "invalid LinearRing provided for type polygon. Linear ring must be an array of coordinates"

```

How can I solve this? Does it mean my coordinates are invalid?

---

<div class="post-metadata">

**Author:** ![Ignacio\_Vera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ignacio_vera/32/36674_2.png) [@Ignacio\_Vera](https://discuss.elastic.co/u/Ignacio_Vera)\
**Post date:** [November 19, 2019, 12:17pm UTC](https://discuss.elastic.co/t/invalid-linearring-provided-for-type-polygon-linear-ring-must-be-an-array-of-coordinates/208428/2 "2019-11-19T12:17:51Z")

</div>

`ignore_malformed` only applies to shapes being indexed not for queries.

The polygon you define indoor query is indeed malformed. Please have at look at [this](https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-shape.html#geo-polygon) on how to define a polygon and other shapes.

---

<div class="post-metadata">

**Author:** ![ohoroyoi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ohoroyoi/32/46820_2.png) [@ohoroyoi](https://discuss.elastic.co/u/ohoroyoi)\
**Post date:** [November 20, 2019, 1:15am UTC](https://discuss.elastic.co/t/invalid-linearring-provided-for-type-polygon-linear-ring-must-be-an-array-of-coordinates/208428/3 "2019-11-20T01:15:04Z")

</div>

I'm sorry but I have another question. this problem solved by creating new index and changing mapping type like this.

```auto
{
    "properties": {
      "boundaries": {
        "type": "geo_shape",
        "precision": "1.0m",
        "strategy": "recursive",
	"distance_error_pct": 0.009,
        "ignore_malformed": "true"
      }
    }
  }

```

If I don't add this setting, is geo\_shape not queried?  
I am confused as to what changes I made to make my query available.

---

<div class="post-metadata">

**Author:** ![Ignacio\_Vera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ignacio_vera/32/36674_2.png) [@Ignacio\_Vera](https://discuss.elastic.co/u/Ignacio_Vera)\
**Post date:** [November 20, 2019, 10:39am UTC](https://discuss.elastic.co/t/invalid-linearring-provided-for-type-polygon-linear-ring-must-be-an-array-of-coordinates/208428/4 "2019-11-20T10:39:41Z")

</div>

I am not sure I understand your last question, could you provide an example what exactly doesn't work with the original mapping? (an example reproducing the issue would be great)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 18, 2019, 10:39am UTC](https://discuss.elastic.co/t/invalid-linearring-provided-for-type-polygon-linear-ring-must-be-an-array-of-coordinates/208428/5 "2019-12-18T10:39:43Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
