# Problems with mapping data as geo\_point datatype

**URL:** <https://discuss.elastic.co/t/problems-with-mapping-data-as-geo-point-datatype/70064>\
**Category:** Elasticsearch\
**Created:** [December 27, 2016, 1:14pm UTC](https://discuss.elastic.co/t/problems-with-mapping-data-as-geo-point-datatype/70064 "2016-12-27T13:14:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![olliewardman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/olliewardman/32/14163_2.png) [@olliewardman](https://discuss.elastic.co/u/olliewardman)\
**Post date:** [December 27, 2016, 1:14pm UTC](https://discuss.elastic.co/t/problems-with-mapping-data-as-geo-point-datatype/70064/1 "2016-12-27T13:14:50Z")

</div>

Hi.

elasticsearch 5.1.1  
kibana 5.1.1  
logstash 5.1.1

I am capturing tweets using the logstash twitter input plugin and passing them to elasticsearch using the elasticsearch output plugin. All works well except I seem unable to correctly map coordinates as the geo\_point datatype.

I append my mapping template below. This is based on David Pilato's excellent article Indexing Twitter with Logstash and Elasticsearch ([http://david.pilato.fr/blog/2015/06/01/indexing-twitter-with-logstash-and-elasticsearch/](http://david.pilato.fr/blog/2015/06/01/indexing-twitter-with-logstash-and-elasticsearch/)).

I know I have coordinates in my elasticsearch index but they are using the float datatype not geo\_point despite the mapping below.

Any help would be much appreciated.

Kind regards.

Oliver

```auto
{
  "template": "twitter",
  "order": 1,
  "settings": {
    "number_of_shards": 1
  },
  "mappings": {
    "tweet": {
      "_all": {
        "enabled": false
      },
      "dynamic_templates": [
        {
          "message_field": {
            "match": "message",
            "match_mapping_type": "string",
            "mapping": {
              "type": "string",
              "index": "analyzed",
              "omit_norms": true
            }
          }
        },
        {
          "string_fields": {
            "match": "*",
            "match_mapping_type": "string",
            "mapping": {
              "type": "string",
              "index": "analyzed",
              "omit_norms": true,
              "fields": {
                "raw": {
                  "type": "string",
                  "index": "not_analyzed",
                  "ignore_above": 256
                }
              }
            }
          }
        }
      ],
      "properties": {
        "text": {
          "type": "string"
        },
        "coordinates": {
          "properties": {
            "coordinates": {
              "type": "geo_point"
            },
            "type": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 27, 2016, 7:37pm UTC](https://discuss.elastic.co/t/problems-with-mapping-data-as-geo-point-datatype/70064/2 "2016-12-27T19:37:35Z")

</div>

Thank you for the comment about the blog 🙂

Can you show as well an example of a Tweet document?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 27, 2016, 7:39pm UTC](https://discuss.elastic.co/t/problems-with-mapping-data-as-geo-point-datatype/70064/3 "2016-12-27T19:39:50Z")

</div>

Here is the template I'm using with 5.0 BTW:

```auto
{
  "template": "twitter*",
  "order": 1,
  "settings": {
    "number_of_shards": 1,
    "mapping.total_fields.limit": 1800
  },
  "mappings": {
    "tweet": {
      "properties": {
        "text": {
          "type": "text"
        },
        "coordinates": {
          "properties": {
             "coordinates": {
                "type": "geo_point"
             },
             "type": {
                "type": "text"
             }
          }
       }
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![olliewardman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/olliewardman/32/14163_2.png) [@olliewardman](https://discuss.elastic.co/u/olliewardman)\
**Post date:** [December 28, 2016, 8:31pm UTC](https://discuss.elastic.co/t/problems-with-mapping-data-as-geo-point-datatype/70064/4 "2016-12-28T20:31:20Z")

</div>

Thanks David.

I append a tweet document below using your new template. This tweet contains coordinates (its one of mine). Does the document look as you would expect? I note that the Tile Map visualisation still doesn't find any geo\_point types in the data.

Kind regards.

Oliver

{  
"took": 1,  
"timed\_out": false,  
"\_shards": {  
"total": 5,  
"successful": 5,  
"failed": 0  
},  
"hits": {  
"total": 1,  
"max\_score": 1,  
"hits": [  
{  
"\_index": "tweet2-2016.12.28",  
"\_type": "tweet",  
"\_id": "AVlHHdi-goIu1XeNUTpB",  
"\_score": 1,  
"\_source": {  
"in\_reply\_to\_status\_id\_str": null,  
"in\_reply\_to\_status\_id": null,  
"created\_at": "Wed Dec 28 20:27:26 +0000 2016",  
"in\_reply\_to\_user\_id\_str": null,  
"source": "\<a href="http://tapbots.com/tweetbot" rel="nofollow"\>Tweetbot for iΟS",  
"retweet\_count": 0,  
"retweeted": false,  
"geo": {  
"coordinates": [  
53.97239888,  
-1.04706316  
],  
"type": "Point"  
},  
"filter\_level": "low",  
"in\_reply\_to\_screen\_name": null,  
"is\_quote\_status": false,  
"id\_str": "814206142326992896",  
"in\_reply\_to\_user\_id": null,  
"@version": "1",  
"favorite\_count": 0,  
"id": 814206142326992900,  
"text": "Testing",  
"place": {  
"country\_code": "GB",  
"country": "United Kingdom",  
"full\_name": "York, England",  
"bounding\_box": {  
"coordinates": [  
[  
[  
-1.147268,  
53.928002  
],  
[  
-1.147268,  
54.004411  
],  
[  
-1.023381,  
54.004411  
],  
[  
-1.023381,  
53.928002  
]  
]  
],  
"type": "Polygon"  
},  
"place\_type": "city",  
"name": "York",  
"attributes": {},  
"id": "0c4f58af36a910a6",  
"url": "[https://api.twitter.com/1.1/geo/id/0c4f58af36a910a6.json](https://api.twitter.com/1.1/geo/id/0c4f58af36a910a6.json)"  
},  
"lang": "en",  
"favorited": false,  
"coordinates": {  
"coordinates": [  
-1.04706316,  
53.97239888  
],  
"type": "Point"  
},  
"truncated": false,  
"timestamp\_ms": "1482956846206",  
"tags": [],  
"@timestamp": "2016-12-28T20:27:26.000Z",  
"entities": {  
"urls": [],  
"hashtags": [],  
"user\_mentions": [],  
"symbols": []  
},  
"contributors": null,  
"user": {  
"utc\_offset": 0,  
"friends\_count": 77,  
"profile\_image\_url\_https": "[https://pbs.twimg.com/profile\_images/2637684812/8d6746d79f6aef88c4af48511162d90c\_normal.jpeg](https://pbs.twimg.com/profile_images/2637684812/8d6746d79f6aef88c4af48511162d90c_normal.jpeg)",  
"listed\_count": 8,  
"profile\_background\_image\_url": "[http://abs.twimg.com/images/themes/theme1/bg.png](http://abs.twimg.com/images/themes/theme1/bg.png)",  
"default\_profile\_image": false,  
"favourites\_count": 9,  
"description": "Occasional musings on tech. Views my own.",  
"created\_at": "Wed Jun 15 18:57:55 +0000 2011",  
"is\_translator": false,  
"profile\_background\_image\_url\_https": "[https://abs.twimg.com/images/themes/theme1/bg.png](https://abs.twimg.com/images/themes/theme1/bg.png)",  
"protected": false,  
"screen\_name": "olliewardman",  
"id\_str": "317958440",  
"profile\_link\_color": "1DA1F2",  
"id": 317958440,  
"geo\_enabled": true,  
"profile\_background\_color": "C0DEED",  
"lang": "en",  
"profile\_sidebar\_border\_color": "C0DEED",  
"profile\_text\_color": "333333",  
"verified": false,  
"profile\_image\_url": "[http://pbs.twimg.com/profile\_images/2637684812/8d6746d79f6aef88c4af48511162d90c\_normal.jpeg](http://pbs.twimg.com/profile_images/2637684812/8d6746d79f6aef88c4af48511162d90c_normal.jpeg)",  
"time\_zone": "London",  
"url": null,  
"contributors\_enabled": false,  
"profile\_background\_tile": false,  
"statuses\_count": 245,  
"follow\_request\_sent": null,  
"followers\_count": 19,  
"profile\_use\_background\_image": true,  
"default\_profile": true,  
"following": null,  
"name": "Oliver Wardman",  
"location": "York, U.K.",  
"profile\_sidebar\_fill\_color": "DDEEF6",  
"notifications": null  
}  
}  
}  
]  
}  
}

---

<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:** [January 25, 2017, 8:31pm UTC](https://discuss.elastic.co/t/problems-with-mapping-data-as-geo-point-datatype/70064/5 "2017-01-25T20:31:39Z")

</div>

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