Elasticsearch: How to insert geo points into a list coordinate

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

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 :slight_smile:

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?

Hi Mark

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

Best Regards

Hung