# Troubles Displaying Geo Points on a Map

**URL:** <https://discuss.elastic.co/t/troubles-displaying-geo-points-on-a-map/227195>\
**Category:** Kibana\
**Tags:** maps\
**Created:** [April 8, 2020, 7:00pm UTC](https://discuss.elastic.co/t/troubles-displaying-geo-points-on-a-map/227195 "2020-04-08T19:00:07Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![nfsouzaj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nfsouzaj/32/65949_2.png) [@nfsouzaj](https://discuss.elastic.co/u/nfsouzaj)\
**Post date:** [April 8, 2020, 7:00pm UTC](https://discuss.elastic.co/t/troubles-displaying-geo-points-on-a-map/227195/1 "2020-04-08T19:00:07Z")

</div>

Hello,  
I am trying to use maps initially to show geo points correlated to airports which is now static data but that in future I want somehow connect to my application health endpoints.

To create my map the following steps were performed:

1. Created a geo template connected to my index pattern (which I created ahead).

```auto
    PUT _template/geotemplate
    {
      "index_patterns": ["airportgeolocation"],
      "settings": { },
        "mappings": {
          "properties": {
            "geolocation": {
                "type": "geo_point"
            }
          }
        }

```

1. Loaded data using a local logstash pointing to my cloud Elastic running on an aks, data was something such as:

> 2564,"Guarulhos - Governador André Franco Montoro International Airport","Sao Paulo","Brazil","GRU","SBGR",-23.435556411743164,-46.47305679321289,2459,-3,"S","America/Sao\_Paulo","airport","OurAirports"

1. Created my index pattern called airportgeolocation  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/2/126a89a904bacf242fcdaac7c8b229d36fd15ae5.png)

I then:

1. Went to Maps and created a new map
2. Added a Layer
3. Selected Documents from the list
4. Gave a name - Airports
5. Added a Tooltip field
6. Set the label border as Large
7. Saved and closed

Still Nothing shows on the map.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/f/7f0591112a58b556894512061700a1e7fb0f1b8b.jpeg)

I added a couple more airports after that but still no luck.

Whenever I go to inspect I can see that the request is bringing 7 hits though.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/a/0a018432adb28679c9470bd4cfac38bac433adfc.png)

I am using:  
Kibana: 7.6.2  
Elastic: 7.6.2  
Logstash: 7.6.2

---

<div class="post-metadata">

**Author:** ![joelgriffith](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joelgriffith/32/53738_2.png) [@joelgriffith](https://discuss.elastic.co/u/joelgriffith)\
**Post date:** [April 8, 2020, 9:34pm UTC](https://discuss.elastic.co/t/troubles-displaying-geo-points-on-a-map/227195/2 "2020-04-08T21:34:34Z")

</div>

@nreese would you be able to offer suggestions on this?

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [April 9, 2020, 1:47am UTC](https://discuss.elastic.co/t/troubles-displaying-geo-points-on-a-map/227195/3 "2020-04-09T01:47:53Z")

</div>

In the inspector tab, what does the response look like?

---

<div class="post-metadata">

**Author:** ![nfsouzaj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nfsouzaj/32/65949_2.png) [@nfsouzaj](https://discuss.elastic.co/u/nfsouzaj)\
**Post date:** [April 9, 2020, 1:13pm UTC](https://discuss.elastic.co/t/troubles-displaying-geo-points-on-a-map/227195/4 "2020-04-09T13:13:10Z")

</div>

Hello @Nathan_Reese, thanks for the answer. Following the copied text from the response:

```auto
{
  "took": 0,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": 7,
    "max_score": 0,
    "hits": [
      {
        "_index": "airportgeolocation",
        "_type": "_doc",
        "_id": "wKxUWnEBATt_XpwlIkcp",
        "_score": 0
      },
      {
        "_index": "airportgeolocation",
        "_type": "_doc",
        "_id": "h6xTWnEBATt_XpwlDDja",
        "_score": 0
      },
      {
        "_index": "airportgeolocation",
        "_type": "_doc",
        "_id": "JqxSWnEBATt_XpwltjR5",
        "_score": 0
      },
      {
        "_index": "airportgeolocation",
        "_type": "_doc",
        "_id": "2KxSWnEBATt_XpwldjAp",
        "_score": 0
      },
      {
        "_index": "airportgeolocation",
        "_type": "_doc",
        "_id": "eKosWnEBATt_XpwlkSEx",
        "_score": 0
      },
      {
        "_index": "airportgeolocation",
        "_type": "_doc",
        "_id": "yqgWWnEBATt_Xpwl2fLP",
        "_score": 0
      },
      {
        "_index": "airportgeolocation",
        "_type": "_doc",
        "_id": "b6gTWnEBATt_Xpwl3Mk1",
        "_score": 0
      }
    ]
  }
}

```

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [April 9, 2020, 1:56pm UTC](https://discuss.elastic.co/t/troubles-displaying-geo-points-on-a-map/227195/5 "2020-04-09T13:56:26Z")

</div>

That is interesting, the hits do not contain any geometries for your points. The response should look more like the below. What does the request look like? And what does the index mapping look like? Do your documents populate the selected geo field?

```auto
{
  "took": 8,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": 245,
    "max_score": 0,
    "hits": [
      {
        "_index": "kibana_sample_data_logs",
        "_id": "iR9NWnEBHkFtYI-lGTL6",
        "_score": 0,
        "fields": {
          "geo.coordinates": [
            "34.2636194312945, -116.85447505675256"
          ]
        }
      },
      {
        "_index": "kibana_sample_data_logs",
        "_id": "iB9NWnEBHkFtYI-lGTL6",
        "_score": 0,
        "fields": {
          "geo.coordinates": [
            "41.55834525357932, -98.54618528857827"
          ]
        }
      },

```

---

<div class="post-metadata">

**Author:** ![nfsouzaj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nfsouzaj/32/65949_2.png) [@nfsouzaj](https://discuss.elastic.co/u/nfsouzaj)\
**Post date:** [April 9, 2020, 2:14pm UTC](https://discuss.elastic.co/t/troubles-displaying-geo-points-on-a-map/227195/6 "2020-04-09T14:14:47Z")

</div>

> [@Nathan\_Reese](#):
>
> What does the request look like

Following the request:

```auto
{
  "docvalue_fields": [
    "geolocation"
  ],
  "size": 10000,
  "_source": false,
  "stored_fields": [
    "geolocation"
  ],
  "script_fields": {},
  "query": {
    "bool": {
      "must": [],
      "filter": [
        {
          "range": {
            "@timestamp": {
              "gte": "2020-04-07T13:11:53.117Z",
              "lte": "2020-04-09T13:11:53.118Z",
              "format": "strict_date_optional_time"
            }
          }
        }
      ],
      "should": [],
      "must_not": []
    }
  }
}

```

The index mapping is the following:

```auto
{
  "mapping": {
    "_doc": {
      "properties": {
        "@timestamp": {
          "type": "date"
        },
        "@version": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "Airport_ID": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "Altitude": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "City": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "Country": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "DST": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "IATA": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "ICAO": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "Latitude": {
          "type": "float"
        },
        "Longitude": {
          "type": "float"
        },
        "Name": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "Source": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "Timezone": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "Type": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "database_time_zone": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "geoLocation": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "geolocation": {
          "type": "geo_point"
        },
        "host": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "message": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "tags": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        }
      }
    }
  }
}

```

Whenever I am loading them I start logstash like this: /usr/share/logstash/bin/logstash -f ./logstash\_geolocation.conf

My Conf file is the following:

```auto
input { 
	stdin { } 
}

filter {
    csv {
    separator => ","
    columns => ["Airport_ID","Name","City","Country","IATA","ICAO","Latitude","Longitude","Altitude","Timezone","DST","database_time_zone","Type","Source"]
  }
  mutate {convert => ["Airport_ID", "string"] }
  mutate {convert => ["Name", "string"] }
  mutate {convert => ["City", "string"] }
  mutate {convert => ["Country", "string"] }
  mutate {convert => ["IATA", "string"] }
  mutate {convert => ["ICAO", "string"] }
  mutate {convert => ["Latitude", "float"] }
  mutate {convert => ["Longitude", "float"] }
  mutate {convert => ["Altitude", "string"] }
  mutate {convert => ["Timezone", "string"] }
  mutate {convert => ["DST", "string"] }
  mutate {convert => ["database_time_zone", "string"] }
  mutate {convert => ["Type", "string"] }
  mutate {convert => ["Source", "string"] }
  mutate {
    add_field => {
      "geoLocation" => "%{Latitude},%{Longitude}"
      }
    }
}

output {
  elasticsearch { 
    hosts => ["elasticsearch-master.monitoring.svc.cluster.local:9200"] 
    index => "airportgeolocation"
  }
  stdout { codec => rubydebug }
}

```

---

<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:** [April 9, 2020, 2:47pm UTC](https://discuss.elastic.co/t/troubles-displaying-geo-points-on-a-map/227195/7 "2020-04-09T14:47:26Z")

</div>

Your mapping has both: `geolocation` and `geoLocation`. Apparently your template is expecting all lowercase but your Logstash filter is adding the field with a capital `L`.

---

<div class="post-metadata">

**Author:** ![nfsouzaj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nfsouzaj/32/65949_2.png) [@nfsouzaj](https://discuss.elastic.co/u/nfsouzaj)\
**Post date:** [April 9, 2020, 3:25pm UTC](https://discuss.elastic.co/t/troubles-displaying-geo-points-on-a-map/227195/8 "2020-04-09T15:25:17Z")

</div>

Thank you Jorge and @Nathan_Reese! worked!  
I erased my index, recreated everything and fixed my bulk/conf file.

Sorry for the dumb error!

---

<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:** [April 9, 2020, 4:20pm UTC](https://discuss.elastic.co/t/troubles-displaying-geo-points-on-a-map/227195/9 "2020-04-09T16:20:04Z")

</div>

No prob, glad we fixed it! 👏

---

<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:** [May 7, 2020, 4:20pm UTC](https://discuss.elastic.co/t/troubles-displaying-geo-points-on-a-map/227195/10 "2020-05-07T16:20:04Z")

</div>

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