# Empty geo\_point being treated as \[-180, -90\]?

**URL:** <https://discuss.elastic.co/t/empty-geo-point-being-treated-as-180-90/78495>\
**Category:** Elasticsearch\
**Created:** [March 14, 2017, 10:50am UTC](https://discuss.elastic.co/t/empty-geo-point-being-treated-as-180-90/78495 "2017-03-14T10:50:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![magrossi](https://avatars.discourse-cdn.com/v4/letter/m/9d8465/32.png) [@magrossi](https://discuss.elastic.co/u/magrossi)\
**Post date:** [March 14, 2017, 10:50am UTC](https://discuss.elastic.co/t/empty-geo-point-being-treated-as-180-90/78495/1 "2017-03-14T10:50:00Z")

</div>

Hi,

I'm migrating an ES cluster from v1.7.5 to v5.1.2 and noticed that empy geo\_point fields are being treated as if they were valid points with coordinates [-180, -90] within geo\_xxx queries. I'm trying to simply get the geo\_bounds of my geo\_point field to determine the area it covers. Previously I used "max" and "min" aggs on each coordinate (lat and lon) to accomplish this (this is just for our own ease of implementation) and now this is not even working (returns "null" for every coordinates max and min).  
Has anyone experienced this? How do I get the geo\_bounds without the empty points being considered? I've tried "bool" \> "must" \> "exists" without success.  
Please see below some examples of what I just reported.

# Mapping

```json
          "Location": {
            "type": "geo_point"
          },

```

# Data Samples

```json
"Location": "-0.533218, 34.5575", << non-empty valid point
"Location": "", << empty invalid point

```

# Query

```json
GET _search
{
    "query": {
        "bool" : {
            "must" : {
                "exists": { "field": "Location" }
            }
        }
    },
    "size": 0,
    "aggs": {
      "Location_bounds": {
        "geo_bounds": {
            "field": "Location"
        }
      },
      "Location_lon_min": {
        "min": {
          "field": "Location.lon"
        }
      },
      "Location_lon_max": {
        "max": {
          "field": "Location.lon"
        }
      },
      "Location_lat_min": {
        "min": {
          "field": "Location.lat"
        }
      },
      "Location_lat_max": {
        "max": {
          "field": "Location.lat"
        }
      }
    }
}

```

# Query result

```json
{
  "took": 3,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
  },
  "hits": {
    "total": 66000,
    "max_score": 0,
    "hits": []
  },
  "aggregations": {
    "Location_lat_min": {
      "value": null
    },
    "Location_lat_max": {
      "value": null
    },
    "Location_lon_min": {
      "value": null
    },
    "Location_lon_max": {
      "value": null
    },
    "Location_bounds": {
      "bounds": {
        "top_left": {
          "lat": 0.5858219834044576,
          "lon": 34.09869999624789
        },
        "bottom_right": {
          "lat": -90,
          "lon": -180
        }
      }
    }
  }
}

```

And I can confirm I have no geo\_point in the [-180, -90] coordinate.

Thank you very much.

---

<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:** [April 11, 2017, 10:49am UTC](https://discuss.elastic.co/t/empty-geo-point-being-treated-as-180-90/78495/2 "2017-04-11T10:49:59Z")

</div>

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