# Latitude Error Upon Reindexing

**URL:** <https://discuss.elastic.co/t/latitude-error-upon-reindexing/96135>\
**Category:** Elasticsearch\
**Created:** [August 7, 2017, 4:26pm UTC](https://discuss.elastic.co/t/latitude-error-upon-reindexing/96135 "2017-08-07T16:26:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![seth.yes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seth.yes/32/11788_2.png) [@seth.yes](https://discuss.elastic.co/u/seth.yes)\
**Post date:** [August 7, 2017, 4:26pm UTC](https://discuss.elastic.co/t/latitude-error-upon-reindexing/96135/1 "2017-08-07T16:26:36Z")

</div>

**ES: 5.4.1**

**_I'm looking for a way to debug this issue, as it is non-standard and likely doesn't have an easy fix.._**

I'm trying to get all my data in the same form, including geolocation data, yet receiving the following error upon attempting to reindex my daily indices:

### illegal latitude value [269.9593658745289] for nginxgeolocation

Which is obviously an incorrect latitude value (too large). However, when I look at the data specific to that unique ID, there is no illegal Latitude value:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/5/15d18594fa649df21ed51e955475563c432f5728.png)

When attempting to reindex my daily indices using the below script (found in the [docs](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-reindex.html#_reindex_daily_indices)), I'm getting the following errors:

### Reindexing Attempt:

#### Command

```auto
POST _reindex
{
  "source": {
    "index": "nginx-2017.04.*"
  },
  "dest": {
    "index": "nginx"
  },
  "script": {
    "lang": "painless",
    "inline": "ctx._index = 'nginx' + (ctx._index.substring('nginx'.length(), ctx._index.length())) + '-1'"
  }
}

```

#### Response

```auto
  "failures": [

    {
      "index": "nginx-2017.04.25-1",
      "type": "nginx-access",
      "id": "AVul3FYdQjKzt0lCbTJQ",
      "cause": {
        "type": "mapper_parsing_exception",
        "reason": "failed to parse",
        "caused_by": {
          "type": "illegal_argument_exception",
          "reason": "illegal latitude value [269.9593658745289] for nginxgeolocation"
        }
      },
      "status": 400
    },
...
]

```

### Mapping:

```auto
{
  "nginx": {
    "order": 0,
    "template": "nginx-*",
    "settings": {
      "index": {
        "number_of_shards": "3",
        "number_of_replicas": "1",
        "routing": {
          "allocation": {
            "require": {
              "box_type": "hot"
            }
          }
        }
      }
    },
    "mappings": {
      "nginx-access": {
        "properties": {
          "nginxgeolocation": {
            "type": "geo_point"
          },
          "nginxgeo1": {
            "type": "geo_point"
          }
        }
      }
    },
    "aliases": {}
  }
}

```

---

<div class="post-metadata">

**Author:** ![seth.yes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seth.yes/32/11788_2.png) [@seth.yes](https://discuss.elastic.co/u/seth.yes)\
**Post date:** [August 7, 2017, 5:27pm UTC](https://discuss.elastic.co/t/latitude-error-upon-reindexing/96135/2 "2017-08-07T17:27:38Z")

</div>

I'm seeing this error outlined here in [Stack Overflow](https://stackoverflow.com/questions/34907078/elasticsearch-rails-illegal-latitude-value). Not really seeing a straightforward way to resolve it though, nor does any of the math I can find online check out..

### If my latitude is being correctly interpreted by Kibana as '37.65...', how am I getting back '269.96...' from Elasticsearch?

---

<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 4, 2017, 5:27pm UTC](https://discuss.elastic.co/t/latitude-error-upon-reindexing/96135/3 "2017-09-04T17:27:49Z")

</div>

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