# Vega Transform Geopoint

**URL:** https://discuss.elastic.co/t/vega-transform-geopoint/251703
**Category:** Kibana
**Tags:** vega
**Created:** [October 12, 2020, 3:14am UTC](https://discuss.elastic.co/t/vega-transform-geopoint/251703 "2020-10-12T03:14:32Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![edbautista](https://avatars.discourse-cdn.com/v4/letter/e/edb3f5/32.png) [@edbautista](https://discuss.elastic.co/u/edbautista)
#### Post date: [October 12, 2020, 3:14am UTC](https://discuss.elastic.co/t/vega-transform-geopoint/251703/1 "2020-10-12T03:14:32Z")

</div>

Hello,

I'm trying to emulate the [Flights] Airport Connections (Hover Over Airport) Vega Visualization. I think the problem is at the transform bloc where the lat and long fields are specified. On the demo, the format is

```auto
location	{
  "lat": 10.7614316,
  "lon": 122.5379966
}

```

My data on the other hand is

```auto
"location" : "14.619258,120.959765"

```

Is there anyway to transform this or should I restructure how my location data is written? Thanks.

---

<div class="post-metadata">

### Author: ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)
#### Post date: [October 13, 2020, 5:56pm UTC](https://discuss.elastic.co/t/vega-transform-geopoint/251703/2 "2020-10-13T17:56:41Z")

</div>

Others may know better, but I haven't seen any [Vega transform](https://vega.github.io/vega/docs/transforms/) to operate in your data results that way. A workaround would be to create an ingest pipeline to generate that output for example using the [Grok processor](https://www.elastic.co/guide/en/elasticsearch/reference/current/grok-processor.html).

Not fully related but if your `location` field is mapped as a `geo_point` type, you may want to give a try to [Elastic Maps](https://www.elastic.co/guide/en/kibana/current/maps.html) capabilties.

---

<div class="post-metadata">

### Author: ![edbautista](https://avatars.discourse-cdn.com/v4/letter/e/edb3f5/32.png) [@edbautista](https://discuss.elastic.co/u/edbautista)
#### Post date: [October 14, 2020, 1:23am UTC](https://discuss.elastic.co/t/vega-transform-geopoint/251703/3 "2020-10-14T01:23:04Z")

</div>

Hi Jorge,

Thanks for the reply.

I also haven't seen Transform for my data results. I already fixed my data to match what is currently accepted. The problem I have right now is that the geo-points aren't visualized properly. Every time I run the vega script, only one point at the upper left of the map shows. I've been reading around and imitating other people's script but I can't seem to make it work.

I have been using Elastic Maps quite extensively for most of our use case. I'm trying to use Vega for this since we need to show the connection between points like in the airport demo.

---

<div class="post-metadata">

### Author: ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)
#### Post date: [October 14, 2020, 9:04am UTC](https://discuss.elastic.co/t/vega-transform-geopoint/251703/4 "2020-10-14T09:04:57Z")

</div>

> [@edbautista](#):
>
> Every time I run the vega script, only one point at the upper left of the map shows.

I'd try to compare your visualization Elasticsearch request and response from the Flights demo. You can check it on your browser console filtering in the network tab for `internal/search/es`

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/6/26473279738f7fb699cfde568c9fdbb37e53978d.png)

> [@edbautista](#):
>
> I have been using Elastic Maps quite extensively for most of our use case. I'm trying to use Vega for this since we need to show the connection between points like in the airport demo.

Have you checked the [Point to Point](https://www.elastic.co/guide/en/kibana/current/point-to-point.html) layer type?

---

<div class="post-metadata">

### Author: ![edbautista](https://avatars.discourse-cdn.com/v4/letter/e/edb3f5/32.png) [@edbautista](https://discuss.elastic.co/u/edbautista)
#### Post date: [October 15, 2020, 5:15am UTC](https://discuss.elastic.co/t/vega-transform-geopoint/251703/5 "2020-10-15T05:15:35Z")

</div>

Point to Point layer type would be perfect for what we want to do but the geo point is not in the same index pattern from our origin and destination data. I have already been able to visualize the points on the map but since the index pattern are different, I'm trying to use lookup similar to this [Mapping Airport Connection Tutorial](https://vega.github.io/vega/tutorials/airports/#plot-connections-among-airports). Still facing some problems with this in Kibana but I'm not sure on what source of the error is. Thank you for your reply and suggestion.

---

<div class="post-metadata">

### Author: ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)
#### Post date: [October 15, 2020, 6:12am UTC](https://discuss.elastic.co/t/vega-transform-geopoint/251703/6 "2020-10-15T06:12:11Z")

</div>

You could use a pipeline to [enrich](https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-processor.html) one index to the other, that is using the common identifier to connect your points.

Maybe an evolution of that is to create a [Transform](https://www.elastic.co/guide/en/elasticsearch/reference/current/transform-overview.html) that summarizes your input dataset (say group by destination) and then in the output index set an ingest pipeline to add the coordinates from the destination index. I'm not sure if pipelines can be used with the result of a transform but may be worth a shot.

---

<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: [November 12, 2020, 6:12am UTC](https://discuss.elastic.co/t/vega-transform-geopoint/251703/7 "2020-11-12T06:12:26Z")

</div>

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