# Mapping GeoJSON MultiPolygons

**URL:** <https://discuss.elastic.co/t/mapping-geojson-multipolygons/21883>\
**Category:** Elasticsearch\
**Created:** [January 28, 2015, 6:04pm UTC](https://discuss.elastic.co/t/mapping-geojson-multipolygons/21883 "2015-01-28T18:04:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![martin\_hoegh](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@martin\_hoegh](https://discuss.elastic.co/u/martin_hoegh)\
**Post date:** [January 28, 2015, 6:04pm UTC](https://discuss.elastic.co/t/mapping-geojson-multipolygons/21883/1 "2015-01-28T18:04:56Z")

</div>

I've a this mapping for indexing GeoJSON MultiPolygons:  
{  
"mappings": {  
"my\_type" : {  
"properties" : {  
"geometry": {  
"type": "object",  
"properties": {  
"coordinates": {  
"type": "geo\_shape",  
"tree": "quadtree",  
"precision": "1m"  
}  
}  
}  
}  
}  
}  
}

My GeoJSON documents look like this:  
{"geometry":{"type":"MultiPolygon","coordinates":[[[[11.271196228214,55.247805547961],[11.271415191178,55.248005636951],[11.272013768321,55.248560723627],[11.272058551835,55.248598558283],[11.273631710783,55.248255507202],[11.274165502845,55.248139089356],[11.2751977725,55.248012026015],[11.276148189941,55.247962910469],[11.276033574199,55.24771532027],[11.2755629564,55.247586277758],[11.275591272403,55.247498363089],[11.275452482819,55.247483495962],[11.27510822465,55.247458465267],[11.274987174807,55.247442898274],[11.274824474983,55.247406085853],[11.274510209456,55.247328216944],[11.273941216581,55.247162791988],[11.273799227027,55.247120235045],[11.273718504568,55.247069399251],[11.2736681305,55.247012460896],[11.273591300644,55.246954289745],[11.27349739339,55.246807549207],[11.27344186075,55.246753115818],[11.271888315476,55.246928766054],[11.270522231629,55.24710369422],[11.270531915141,55.247114857522],[11.270465084795,55.247142572448],[11.27052135682,55.247178027612],[11.270671844775,55.247285794714],[11.271196228214,55.247805547961]]]]},"type":"Feature","properties":{"gid":2}}

And I get:  
{"took":1,"errors":true,"items":[{"index":{"\_index":"mydb\_test","\_type":"my\_type","\_id":"2","status":400,"error":"MapperParsingException[failed  
to parse [geometry.coordinates]]; nested: ElasticsearchParseException[Shape  
must be an object consisting of type and coordinates]; "}}]}

I guess the mapping is wrong?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/3c0b181c-361d-4dc9-90c7-8ef879fd7a65%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3c0b181c-361d-4dc9-90c7-8ef879fd7a65%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:36am UTC](https://discuss.elastic.co/t/mapping-geojson-multipolygons/21883/2 "2017-07-06T00:36:06Z")

</div>


