# GeoJson GeometryCollection failed to parse

**URL:** https://discuss.elastic.co/t/geojson-geometrycollection-failed-to-parse/141441
**Category:** Elasticsearch
**Created:** [July 24, 2018, 7:48pm UTC](https://discuss.elastic.co/t/geojson-geometrycollection-failed-to-parse/141441 "2018-07-24T19:48:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Artem\_Sh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/artem_sh/32/37638_2.png) [@Artem\_Sh](https://discuss.elastic.co/u/Artem_Sh)
#### Post date: [July 24, 2018, 7:48pm UTC](https://discuss.elastic.co/t/geojson-geometrycollection-failed-to-parse/141441/1 "2018-07-24T19:48:35Z")

</div>

`{'index': {'status': 400, 'data': {'slug': 'kohma', 'timezone': 'Europe/Moscow', 'population_type': 15000, 'region': 'Ивановская область, Россия', 'declension_rus': {'pretext': 'в Кохме', 'gen': 'Кохмы', 'nom': 'Кохма', 'dat': 'Кохме', 'ins': 'Кохмой', 'pre': 'Кохме', 'acc': 'Кохму'}, 'polygone': '{ "type": "GeometryCollection", "geometries": [{ "type": "Polygon", "coordinates": [ [ [ 41.059209, 56.943223], [41.073484, 56.944912], [41.074015, 56.944572], [41.076783, 56.944583], [41.078296, 56.944759], [41.079047, 56.943768], [41.07948, 56.943584], [41.081455, 56.943302], [41.08257, 56.943244], [41.083686, 56.943431], [41.084469, 56.94332], [41.085772, 56.944262], [41.088174, 56.944828], [41.087821, 56.946699], [41.089337, 56.947018], [41.089802, 56.94698], [41.091531, 56.947527], [41.091207, 56.947707], [41.09721, 56.951118], [41.101512, 56.951218], [41.105428, 56.951171], [41.107424, 56.951405], [41.111062, 56.947463], [41.114469, 56.94318], [41.115119, 56.94354], [41.116439, 56.94391], [41.124585, 56.94589], [41.126256, 56.94339], [41.127653, 56.94218], [41.1265, 56.941903], [41.128646, 56.939756], [41.12753, 56.939475], [41.13106, 56.936923], [41.132154, 56.937557], [41.13297, 56.93826], [41.134686, 56.937756], [41.136661, 56.936829], [41.136618, 56.935903], [41.137476, 56.93487], [41.136746, 56.934495], [41.137197, 56.933838], [41.134257, 56.933416], [41.132219, 56.933416], [41.13003, 56.933252], [41.129022, 56.931961], [41.128571, 56.930413], [41.131053, 56.92785], [41.132094, 56.927988], [41.133776, 56.92653], [41.129651, 56.925137], [41.130266, 56.924206], [41.12752, 56.922094], [41.12222, 56.923361], [41.119688, 56.921151], [41.111268, 56.923989], [41.110509, 56.923472], [41.109264, 56.923507], [41.106131, 56.923132], [41.105639, 56.923257], [41.105105, 56.923077], [41.106158, 56.922535], [41.106858, 56.921652], [41.111823, 56.919293], [41.11347, 56.914482], [41.112701, 56.914511], [41.112666, 56.912234], [41.104943, 56.912862], [41.099511, 56.912789], [41.099721, 56.91226], [41.099393, 56.911891], [41.098105, 56.911527], [41.094102, 56.910949], [41.09249, 56.91403], [41.091138, 56.913819], [41.090859, 56.914183], [41.092425, 56.914711], [41.091595, 56.915888], [41.081761, 56.912199], [41.076032, 56.91241], [41.07151, 56.916712], [41.075361, 56.921497], [41.07719, 56.922618], [41.07438, 56.924806], [41.068565, 56.922354], [41.06688, 56.923287], [41.067803, 56.924806], [41.069466, 56.926631], [41.072942, 56.927951], [41.073714, 56.928039], [41.074294, 56.928496], [41.074701, 56.929259], [41.074208, 56.929394], [41.074068, 56.929599], [41.073532, 56.929834], [41.072384, 56.930033], [41.072974, 56.930233], [41.071966, 56.930831], [41.071912, 56.931253], [41.071644, 56.931564], [41.069906, 56.932772], [41.069509, 56.932802], [41.06894, 56.932632], [41.068768, 56.932726], [41.069423, 56.933218], [41.069712, 56.93391], [41.069455, 56.934315], [41.067288, 56.933764], [41.065507, 56.934034], [41.064702, 56.935154], [41.065067, 56.935576], [41.064683, 56.937746], [41.063207, 56.938626], [41.057418, 56.940753], [41.05682, 56.941489], [41.056559, 56.942594], [41.059209, 56.943223] ] ] } ] }', 'population': 28984, 'point': [41.0915, 56.93487], 'name': 'Кохма', 'project': 'spravbiz.ru'}, '_type': 'doc', '_id': '500', 'error': {'reason': 'failed to parse [polygone]', 'caused_by': {'reason': 'shape must be an object consisting of type and coordinates', 'type': 'parse_exception'}, 'type': 'mapper_parsing_exception'}, '_index': 'wbtm_cities'}}])`

I am add GeometryCollection in index and it's write error **shape must be an object consisting of type and coordinates**

How I may add GeometryCollection?

Test coords, wkt, geojson format don't work

---

<div class="post-metadata">

### Author: ![shanec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shanec/32/4004_2.png) [@shanec](https://discuss.elastic.co/u/shanec)
#### Post date: [July 25, 2018, 8:27pm UTC](https://discuss.elastic.co/t/geojson-geometrycollection-failed-to-parse/141441/2 "2018-07-25T20:27:45Z")

</div>

It's a little difficult to see what's going on with the formatting like this, since you have single-quotes and double-quotes intermixed and the spacing is difficult to read. But here's a simple example that uses your data that works:

```auto
PUT test
{
  "mappings": {
    "_doc": {
      "properties": {
        "polygone": {
          "type": "geo_shape"
        }
      }
    }
  }
}

```

and then

```auto
POST /test/_doc
{
	"polygone": {
		"type": "GeometryCollection",
		"geometries": [{
			"type": "Polygon",
			"coordinates": [
				[
					[41.059209, 56.943223],
					[41.073484, 56.944912],
					[41.074015, 56.944572],
					[41.076783, 56.944583],
					[41.078296, 56.944759],
					[41.079047, 56.943768],
					[41.07948, 56.943584],
					[41.081455, 56.943302],
					[41.08257, 56.943244],
					[41.083686, 56.943431],
					[41.084469, 56.94332],
					[41.085772, 56.944262],
					[41.088174, 56.944828],
					[41.087821, 56.946699],
					[41.089337, 56.947018],
					[41.089802, 56.94698],
					[41.091531, 56.947527],
					[41.091207, 56.947707],
					[41.09721, 56.951118],
					[41.101512, 56.951218],
					[41.105428, 56.951171],
					[41.107424, 56.951405],
					[41.111062, 56.947463],
					[41.114469, 56.94318],
					[41.115119, 56.94354],
					[41.116439, 56.94391],
					[41.124585, 56.94589],
					[41.126256, 56.94339],
					[41.127653, 56.94218],
					[41.1265, 56.941903],
					[41.128646, 56.939756],
					[41.12753, 56.939475],
					[41.13106, 56.936923],
					[41.132154, 56.937557],
					[41.13297, 56.93826],
					[41.134686, 56.937756],
					[41.136661, 56.936829],
					[41.136618, 56.935903],
					[41.137476, 56.93487],
					[41.136746, 56.934495],
					[41.137197, 56.933838],
					[41.134257, 56.933416],
					[41.132219, 56.933416],
					[41.13003, 56.933252],
					[41.129022, 56.931961],
					[41.128571, 56.930413],
					[41.131053, 56.92785],
					[41.132094, 56.927988],
					[41.133776, 56.92653],
					[41.129651, 56.925137],
					[41.130266, 56.924206],
					[41.12752, 56.922094],
					[41.12222, 56.923361],
					[41.119688, 56.921151],
					[41.111268, 56.923989],
					[41.110509, 56.923472],
					[41.109264, 56.923507],
					[41.106131, 56.923132],
					[41.105639, 56.923257],
					[41.105105, 56.923077],
					[41.106158, 56.922535],
					[41.106858, 56.921652],
					[41.111823, 56.919293],
					[41.11347, 56.914482],
					[41.112701, 56.914511],
					[41.112666, 56.912234],
					[41.104943, 56.912862],
					[41.099511, 56.912789],
					[41.099721, 56.91226],
					[41.099393, 56.911891],
					[41.098105, 56.911527],
					[41.094102, 56.910949],
					[41.09249, 56.91403],
					[41.091138, 56.913819],
					[41.090859, 56.914183],
					[41.092425, 56.914711],
					[41.091595, 56.915888],
					[41.081761, 56.912199],
					[41.076032, 56.91241],
					[41.07151, 56.916712],
					[41.075361, 56.921497],
					[41.07719, 56.922618],
					[41.07438, 56.924806],
					[41.068565, 56.922354],
					[41.06688, 56.923287],
					[41.067803, 56.924806],
					[41.069466, 56.926631],
					[41.072942, 56.927951],
					[41.073714, 56.928039],
					[41.074294, 56.928496],
					[41.074701, 56.929259],
					[41.074208, 56.929394],
					[41.074068, 56.929599],
					[41.073532, 56.929834],
					[41.072384, 56.930033],
					[41.072974, 56.930233],
					[41.071966, 56.930831],
					[41.071912, 56.931253],
					[41.071644, 56.931564],
					[41.069906, 56.932772],
					[41.069509, 56.932802],
					[41.06894, 56.932632],
					[41.068768, 56.932726],
					[41.069423, 56.933218],
					[41.069712, 56.93391],
					[41.069455, 56.934315],
					[41.067288, 56.933764],
					[41.065507, 56.934034],
					[41.064702, 56.935154],
					[41.065067, 56.935576],
					[41.064683, 56.937746],
					[41.063207, 56.938626],
					[41.057418, 56.940753],
					[41.05682, 56.941489],
					[41.056559, 56.942594],
					[41.059209, 56.943223]
				]
			]
		}]
	}
}

```

---

<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: [August 22, 2018, 8:27pm UTC](https://discuss.elastic.co/t/geojson-geometrycollection-failed-to-parse/141441/3 "2018-08-22T20:27:49Z")

</div>

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