# Elasticsearch: How to insert geo points into a list coordinate

**URL:** <https://discuss.elastic.co/t/elasticsearch-how-to-insert-geo-points-into-a-list-coordinate/246239>\
**Category:** Elasticsearch\
**Created:** [August 25, 2020, 7:36am UTC](https://discuss.elastic.co/t/elasticsearch-how-to-insert-geo-points-into-a-list-coordinate/246239 "2020-08-25T07:36:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hung\_M\_Le](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hung_m_le/32/54995_2.png) [@Hung\_M\_Le](https://discuss.elastic.co/u/Hung_M_Le)\
**Post date:** [August 25, 2020, 7:36am UTC](https://discuss.elastic.co/t/elasticsearch-how-to-insert-geo-points-into-a-list-coordinate/246239/1 "2020-08-25T07:36:57Z")

</div>

Hi

I have followed the example in the document to draw a polygon on a map. Here are the setting.

PUT /admnycoord  
{  
"mappings": {  
"properties": {  
"location": {  
"type": "geo\_shape"  
}  
}  
}  
}

POST /admnycoord/\_doc?refresh  
{  
"name": "NY",  
"location": {  
"type": "Polygon",  
"coordinates" : [  
[[-74.3615,40.4433],[-74.3615,40.9823],[-73.6504,40.9823],[-73.6504,40.4433],[-74.3615,40.4433] ]  
]  
}  
}

If I have the following fields (geo\_points) defined in the schema as and data will be extracted and store inside these fields:  
|navlog.context.bbox\_point\_0|geo\_point  
|navlog.context.bbox\_point\_1|geo\_point  
|navlog.context.bbox\_point\_2|geo\_point  
|navlog.context.bbox\_point\_3|geo\_point

Question: How can I replace the above field inside the above list of coordinates. For example, I would like to have the follow code change:

POST /admnycoord/\_doc?refresh  
{  
"name": "NY",  
"location": {  
"type": "Polygon",  
"coordinates" : [  
[[navlog.context.bbox\_point\_0],[navlog.context.bbox\_point\_1],[navlog.context.bbox\_point\_2],[navlog.context.bbox\_point\_3],[navlog.context.bbox\_point\_0] ]  
]  
}  
}

Thank you in advance for your prompt response and help.

Best Regards

Hung

---

<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:** [August 26, 2020, 12:47am UTC](https://discuss.elastic.co/t/elasticsearch-how-to-insert-geo-points-into-a-list-coordinate/246239/2 "2020-08-26T00:47:05Z")

</div>

Please format your code/logs/config using the `</>` button, or markdown style back ticks. It helps to make things easy to read which helps us help you 🙂

Just to be clear, you want to pull the individual geopoints from documents in another index into the single geo shape, using variables or similar?

---

<div class="post-metadata">

**Author:** ![Hung\_M\_Le](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hung_m_le/32/54995_2.png) [@Hung\_M\_Le](https://discuss.elastic.co/u/Hung_M_Le)\
**Post date:** [August 26, 2020, 7:41am UTC](https://discuss.elastic.co/t/elasticsearch-how-to-insert-geo-points-into-a-list-coordinate/246239/3 "2020-08-26T07:41:31Z")

</div>

Hi Mark

Thank you for your response. To answer to your question, the answer is yes!

Best Regards

Hung

---

<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:** [September 23, 2020, 7:41am UTC](https://discuss.elastic.co/t/elasticsearch-how-to-insert-geo-points-into-a-list-coordinate/246239/4 "2020-09-23T07:41:36Z")

</div>

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