# Geo\_shape and NullPointerException

**URL:** <https://discuss.elastic.co/t/geo-shape-and-nullpointerexception/10488>\
**Category:** Elasticsearch\
**Created:** [January 24, 2013, 11:57am UTC](https://discuss.elastic.co/t/geo-shape-and-nullpointerexception/10488 "2013-01-24T11:57:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Przemek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/przemek/32/2515_2.png) [@Przemek](https://discuss.elastic.co/u/Przemek)\
**Post date:** [January 24, 2013, 11:57am UTC](https://discuss.elastic.co/t/geo-shape-and-nullpointerexception/10488/1 "2013-01-24T11:57:19Z")

</div>

Hello,  
I am testing out the geo\_shape type described here:  
[http://www.elasticsearch.org/guide/reference/mapping/geo-shape-type.html](http://www.elasticsearch.org/guide/reference/mapping/geo-shape-type.html)  
I have created a mapping and provided a sample data to it, but  
ElasticSearch throws a NullPointerException at me, more details here:

> <https://gist.github.com/CGenie/5ca45633dede9cc8dc1c>

  
Am I sending the data in wrong format?

P.

--

---

<div class="post-metadata">

**Author:** ![Jilles\_van\_Gurp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jilles_van_gurp/32/879_2.png) [@Jilles\_van\_Gurp](https://discuss.elastic.co/u/Jilles_van_Gurp)\
**Post date:** [January 31, 2013, 10:12am UTC](https://discuss.elastic.co/t/geo-shape-and-nullpointerexception/10488/2 "2013-01-31T10:12:46Z")

</div>

Elastic search is currently not very forgiving when it comes to these  
things and it doesn't help that the examples in the documents are fragments  
rather than complete working examples.

I've pasted a working mapping that uses geo\_shape  
here: [sample mapping with geo\_shape - Pastebin.com](http://pastebin.com/yDzL3qxz)

I've only managed to get filter queries working with this. With the regular  
query I always run into a max clauses error.  
Jilles

On Thursday, January 24, 2013 12:57:19 PM UTC+1, Przemek wrote:

> Hello,  
> I am testing out the geo\_shape type described here:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/geo-shape-type.html)  
> I have created a mapping and provided a sample data to it, but  
> Elasticsearch throws a NullPointerException at me, more details here:  
> [elasticsearch\_multipolygon\_error · GitHub](https://gist.github.com/5ca45633dede9cc8dc1c)  
> Am I sending the data in wrong format?
> 
> P.

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![drull](https://avatars.discourse-cdn.com/v4/letter/d/b77776/32.png) [@drull](https://discuss.elastic.co/u/drull)\
**Post date:** [January 27, 2015, 2:33pm UTC](https://discuss.elastic.co/t/geo-shape-and-nullpointerexception/10488/3 "2015-01-27T14:33:19Z")

</div>

Yep, format is wrong. Wrap coordinates to one more array. Like this:  
{  
"boundaries" : {  
"type" : "multipolygon",  
"coordinates" :  
[[[  
[-74.0137499999999, 40.728304],  
[-74.0137349999999, 40.728302],  
[-74.0137429999999, 40.7282450000001],  
[-74.013888, 40.728258],  
[-74.0138789999999, 40.7283140000001],  
[-74.0137499999999, 40.728304]  
]]]  
},  
"\_id" : 3  
}

Hello, I am testing out the geo\_shape type described here: http://www.elasticsearch.org/guide/reference/mapping/geo-shape-type.html I have created a mapping and provided a sample data to it, but ElasticSearch throws a NullPointerException at me, more details here: https://gist.github.com/5ca45633dede9cc8dc1c Am I sending the data in wrong format?

P.

--

---

<div class="post-metadata">

**Author:** ![Jilles\_van\_Gurp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jilles_van_gurp/32/879_2.png) [@Jilles\_van\_Gurp](https://discuss.elastic.co/u/Jilles_van_Gurp)\
**Post date:** [January 28, 2015, 1:21pm UTC](https://discuss.elastic.co/t/geo-shape-and-nullpointerexception/10488/4 "2015-01-28T13:21:27Z")

</div>

Yeah, looks like that is the problem indeed. Probably, es needs a bit more  
friendly error here. This is a common mistake with geojson.

Jilles

On Wednesday, January 28, 2015 at 2:16:25 PM UTC+1, Roman Drogolov wrote:

> Yep, format is wrong. Wrap coordinates to one more array. Like this:  
> {  
> "boundaries" : {  
> "type" : "multipolygon",  
> "coordinates" :  
> [[[  
> [-74.0137499999999, 40.728304],  
> [-74.0137349999999, 40.728302],  
> [-74.0137429999999,  
> 40.7282450000001],  
> [-74.013888, 40.728258],  
> [-74.0138789999999,  
> 40.7283140000001],  
> [-74.0137499999999, 40.728304]  
> ]]]  
> },  
> "\_id" : 3  
> }
> 
> Przemek wrote
> 
> > Hello,  
> > I am testing out the geo\_shape type described here:  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/geo-shape-type.html)  
> > I have created a mapping and provided a sample data to it, but  
> > Elasticsearch throws a NullPointerException at me, more details here:  
> > [elasticsearch\_multipolygon\_error · GitHub](https://gist.github.com/5ca45633dede9cc8dc1c)  
> > Am I sending the data in wrong format?
> > 
> > P.
> > 
> > --
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/geo-shape-and-NullPointerException-tp4028704p4069653.html](http://elasticsearch-users.115913.n3.nabble.com/geo-shape-and-NullPointerException-tp4028704p4069653.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--  
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/45315391-73c2-4c22-a6c3-3353c91151d5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/45315391-73c2-4c22-a6c3-3353c91151d5%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/geo-shape-and-nullpointerexception/10488/5 "2017-07-06T00:36:10Z")

</div>


