# Failed to parse field \[location\] of type \[geo\_shape\]

**URL:** <https://discuss.elastic.co/t/failed-to-parse-field-location-of-type-geo-shape/187773>\
**Category:** Elasticsearch\
**Created:** [June 27, 2019, 7:36am UTC](https://discuss.elastic.co/t/failed-to-parse-field-location-of-type-geo-shape/187773 "2019-06-27T07:36:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sjaak01](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Sjaak01](https://discuss.elastic.co/u/Sjaak01)\
**Post date:** [June 27, 2019, 7:36am UTC](https://discuss.elastic.co/t/failed-to-parse-field-location-of-type-geo-shape/187773/1 "2019-06-27T07:36:06Z")

</div>

Hi,

I have a single geojson file that Elastic refuses to ingest. The file opens fine in QGIS and online viewers and also is accepted by Geoserver when exported as a shapefile.

If I convert the polygons to lines then I can ingest it into Elastic but for whatever reason it does not work with the file as a multipolygon.

I cannot upload the actual file as it contains data that is not allowed to be shared but looking at the file it looks the same as the other multipolygon geojson I ingested without problems.

Error:

> {  
> "error": {  
> "root\_cause": [  
> {  
> "type": "mapper\_parsing\_exception",  
> "reason": "failed to parse field [location] of type [geo\_shape]"  
> }  
> ],  
> "type": "mapper\_parsing\_exception",  
> "reason": "failed to parse field [location] of type [geo\_shape]",  
> "caused\_by": {  
> "type": "class\_cast\_exception",  
> "reason": "class org.elasticsearch.geo.geometry.MultiPolygon cannot be cast to class org.elasticsearch.geo.geometry.Polygon (org.elasticsearch.geo.geometry.MultiPolygon and org.elasticsearch.geo.geometry.Polygon are in unnamed module of loader 'app')"  
> }  
> },  
> "status": 400  
> }

---

<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:** [June 27, 2019, 8:53am UTC](https://discuss.elastic.co/t/failed-to-parse-field-location-of-type-geo-shape/187773/2 "2019-06-27T08:53:09Z")

</div>

Could you add which version of Elasticsearch you are using?

---

<div class="post-metadata">

**Author:** ![Sjaak01](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Sjaak01](https://discuss.elastic.co/u/Sjaak01)\
**Post date:** [June 27, 2019, 11:33pm UTC](https://discuss.elastic.co/t/failed-to-parse-field-location-of-type-geo-shape/187773/3 "2019-06-27T23:33:30Z")

</div>

I'm using 7.2.

---

<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:** [June 28, 2019, 9:24am UTC](https://discuss.elastic.co/t/failed-to-parse-field-location-of-type-geo-shape/187773/4 "2019-06-28T09:24:06Z")

</div>

Hi,

I cannot reproduce it, could you share the stack-trace that you find in the logs. That will tell me where the error is happening.

---

<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:** [July 26, 2019, 9:24am UTC](https://discuss.elastic.co/t/failed-to-parse-field-location-of-type-geo-shape/187773/5 "2019-07-26T09:24:07Z")

</div>

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