# How to select two coordinates from \[x,y,z\] array?

**URL:** <https://discuss.elastic.co/t/how-to-select-two-coordinates-from-x-y-z-array/224341>\
**Category:** Kibana\
**Created:** [March 20, 2020, 3:04am UTC](https://discuss.elastic.co/t/how-to-select-two-coordinates-from-x-y-z-array/224341 "2020-03-20T03:04:41Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![lukeelmers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukeelmers/32/35230_2.png) [@lukeelmers](https://discuss.elastic.co/u/lukeelmers)\
**Post date:** [March 20, 2020, 5:20pm UTC](https://discuss.elastic.co/t/how-to-select-two-coordinates-from-x-y-z-array/224341/2 "2020-03-20T17:20:25Z")

</div>

Hi @Agrikk!

While you could use scripted fields to technically get the data into the shape of a geo\_point (e.g. something like this in Painless: `[params._source.geometry.coordinates[0], params._source.geometry.coordinates[1]]`), the problem you are going to run into is that the type of that field needs to be mapped to `geo_point`, and you can't currently do this in Kibana scripted fields.

Without that mapping in place, you aren't going to be able to visualize those coordinates on a map.

The best practice for a situation like this is modify your ingest to convert the data into the correct geo\_point format. Depending on your setup there are a couple ways to do this:

1. configure it in logstash as described in [Problem converting latitude and longitude into a geo point for Kibana](https://discuss.elastic.co/t/problem-converting-latitude-and-longitude-into-a-geo-point-for-kibana/52856)
2. or to update the data you have already ingested, set up an ingest pipeline in elasticsearch and reindex as described in [Reindex to add geo\_point mapping](https://discuss.elastic.co/t/reindex-to-add-geo-point-mapping/202052/2)

---

_[View the full topic](https://discuss.elastic.co/t/how-to-select-two-coordinates-from-x-y-z-array/224341)._
