# Cannot insert a geopoint

**URL:** https://discuss.elastic.co/t/cannot-insert-a-geopoint/107234
**Category:** Elasticsearch
**Created:** [November 10, 2017, 7:19pm UTC](https://discuss.elastic.co/t/cannot-insert-a-geopoint/107234 "2017-11-10T19:19:23Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Marek](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Marek](https://discuss.elastic.co/u/Marek)
#### Post date: [November 10, 2017, 7:19pm UTC](https://discuss.elastic.co/t/cannot-insert-a-geopoint/107234/1 "2017-11-10T19:19:23Z")

</div>

I try to insert a document with body:

{  
"user\_uuid":"234",  
"description":"",  
"category":"art",  
"location":{  
"lat":52.582014799999996,  
"lon":13.4913122  
},  
"url":"[http://172.19.0.4:9000/arbotti/r1RgVuQJMS1xRg4\_Xkz](http://172.19.0.4:9000/arbotti/r1RgVuQJMS1xRg4_Xkz)"  
}

And get the error:  
{  
"error": {  
"root\_cause": [  
{  
"type": "remote\_transport\_exception",  
"reason": "[172.19.0.2][172.19.0.2:9300][indices:data/write/bulk[s][p]]"  
}  
],  
"type": "class\_cast\_exception",  
"reason": "java.lang.Double cannot be cast to java.lang.Float"  
},  
"status": 500  
}

I do not understand why the lat/lon pair is treated as Double.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [November 10, 2017, 9:23pm UTC](https://discuss.elastic.co/t/cannot-insert-a-geopoint/107234/2 "2017-11-10T21:23:15Z")

</div>

What is the mapping on that field?

---

<div class="post-metadata">

### Author: ![Marek](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Marek](https://discuss.elastic.co/u/Marek)
#### Post date: [November 10, 2017, 9:35pm UTC](https://discuss.elastic.co/t/cannot-insert-a-geopoint/107234/3 "2017-11-10T21:35:33Z")

</div>

Mark,

The problem seems gone after I dropped the index and recreated it.  
The mapping is geopoint. Seems to work now.

Thank you Mark anyway!

Marek

---

<div class="post-metadata">

### Author: ![Marek](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Marek](https://discuss.elastic.co/u/Marek)
#### Post date: [November 21, 2017, 2:09pm UTC](https://discuss.elastic.co/t/cannot-insert-a-geopoint/107234/4 "2017-11-21T14:09:31Z")

</div>

Dear Mark,

Perhaps you can help me. I am using elastic version 5.5.0  
I am having a problem with this simple update:

[http://localhost:9200/post\_elastic/AV\_e3-gqARzXw\_Stq0-5/\_update](http://localhost:9200/post_elastic/AV_e3-gqARzXw_Stq0-5/_update)

{  
"script" : {  
"inline": "ctx.\_source.likes += 1",  
"lang": "painless"  
}  
}

This leads to:

{  
"error": {  
"root\_cause": [  
{  
"type": "remote\_transport\_exception",  
"reason": "[172.19.0.3][172.19.0.3:9300][indices:data/write/update[s]]"  
}  
],  
"type": "illegal\_argument\_exception",  
"reason": "failed to execute script",  
"caused\_by": {  
"type": "script\_exception",  
"reason": "compile error",  
"script\_stack": [],  
"script": "ctx.\_source.likes += 1",  
"lang": "painless",  
"caused\_by": {  
"type": "runtime\_exception",  
"reason": "java.lang.ClassNotFoundException: org.elasticsearch.painless.PainlessError"  
}  
}  
},  
"status": 400  
}

The field to be incremented is an integer.  
"likes": {  
"type": "integer"  
},

Can you please help me to get to the root of the problem?  
Thank you.

Best regards,  
Marek

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [November 21, 2017, 6:52pm UTC](https://discuss.elastic.co/t/cannot-insert-a-geopoint/107234/5 "2017-11-21T18:52:40Z")

</div>

It'd be better if you started another thread, as that's unrelated to the original question so those that can best assist are unlikely to see the question 🙂

---

<div class="post-metadata">

### Author: ![Marek](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Marek](https://discuss.elastic.co/u/Marek)
#### Post date: [November 22, 2017, 9:37pm UTC](https://discuss.elastic.co/t/cannot-insert-a-geopoint/107234/6 "2017-11-22T21:37:21Z")

</div>

Thank you Mark. I have created the new thread: [Cannot execute update by script](https://discuss.elastic.co/t/cannot-execute-update-by-script/108795) [https://discuss.elastic.co/t/cannot-execute-update-by-script/108795](https://discuss.elastic.co/t/cannot-execute-update-by-script/108795)

---

<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 20, 2017, 9:38pm UTC](https://discuss.elastic.co/t/cannot-insert-a-geopoint/107234/7 "2017-12-20T21:38:05Z")

</div>

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