# Ingest processor to set array of geo\_points

**URL:** https://discuss.elastic.co/t/ingest-processor-to-set-array-of-geo-points/231047
**Category:** Elasticsearch
**Created:** [May 4, 2020, 9:59pm UTC](https://discuss.elastic.co/t/ingest-processor-to-set-array-of-geo-points/231047 "2020-05-04T21:59:03Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![seanziee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seanziee/32/45151_2.png) [@seanziee](https://discuss.elastic.co/u/seanziee)
#### Post date: [May 4, 2020, 9:59pm UTC](https://discuss.elastic.co/t/ingest-processor-to-set-array-of-geo-points/231047/1 "2020-05-04T21:59:03Z")

</div>

I'm trying to create an array of geo\_points from a document that has 2 different sets of geo\_points. I want to combine these two fields into one field that I can visualize on a map. My locations in dest/source\_lookup.Location are lat, lon and the array of geo points needs to be lon, lat (which is why I do split and append like I do). My processors look like:

```auto
 {
        "split": {
          "field": "source_lookup.Location",
          "separator": ",",
          "target_field": "src_loc",
          "ignore_missing": true
        }
      },
      {
        "split": {
          "field": "dest_lookup.Location",
          "separator": ",",
          "target_field": "dest_loc",
          "ignore_missing": true
        }
      },
      {
        "convert": {
          "field": "dest_loc",
          "type": "float",
          "ignore_missing": true
        }
      },
      {
        "convert": {
          "field": "src_loc",
          "type": "float",
          "ignore_missing": true
        }
      },
      {
        "script": {
          "if": "ctx.containsKey('src_loc')&&ctx.containsKey('dest_loc')",
          "lang": "painless",
          "source": "ArrayList y = [[ctx.src_loc[1],ctx.src_loc[0]],[ctx.dest_loc[1],ctx.dest_loc[0]]]; ctx.Locations = y"
        }
      }

```

This results in the following:

```auto
         "Locations" : [
            [-122.08555, 37.42259],
            [-122.08433, 37.42267]
          ],
          "source" : {
            "address" : "192.168.1.98"
          },
          "source_lookup" : {
            "Location" : "37.42259, -122.08555"
          }
          "src_loc" : [
            37.42259,
            -122.08555
          ],
          "dest_loc" : [
            37.42267,
            -122.08433
          ],
          "dest_lookup" : {
            "Location" : "37.42267, -122.08433"
          }

```

But I get error:

```auto
"cause" : {
        "type" : "mapper_parsing_exception",
        "reason" : "failed to parse field [Locations] of type [geo_point]",
        "caused_by" : {
          "type" : "parse_exception",
          "reason" : "latitude must be a number"
        }
      }

```

What can I do?

---

<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: [June 1, 2020, 10:29pm UTC](https://discuss.elastic.co/t/ingest-processor-to-set-array-of-geo-points/231047/3 "2020-06-01T22:29:13Z")

</div>

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