# Geo Point

**URL:** <https://discuss.elastic.co/t/geo-point/93010>\
**Category:** Elasticsearch\
**Created:** [July 13, 2017, 12:38pm UTC](https://discuss.elastic.co/t/geo-point/93010 "2017-07-13T12:38:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tals](https://avatars.discourse-cdn.com/v4/letter/t/f1d935/32.png) [@Tals](https://discuss.elastic.co/u/Tals)\
**Post date:** [July 13, 2017, 12:38pm UTC](https://discuss.elastic.co/t/geo-point/93010/1 "2017-07-13T12:38:56Z")

</div>

Hi  
I'm new in ES.  
I have Json like this  
{"altitde": 10972.8,"callsign": "","heading": 191.74,"icao24": "842194","latitde": 36.666,"longitde":35.222,"on\_grond": true,"origin\_contry": "Japan","sensors": false,"time\_position": 0,"time\_velocity": 1499164181,"velocity": 199.67,"vertical\_rate": 0,"location": [40.0233,80.3336]}  
I can fit it as I wish but right now I try to map like this  
},  
"geoip" : {  
"type" : "object",  
"dynamic": true,  
"properties" : {  
"location" : { "type" : "geo\_point" },  
"latitude" : { "type" : "half\_float" },  
"longitude" : { "type" : "half\_float" }  
}  
Please advise how can I fit the Json to mapping or mappint to this Json  
Thanks  
Tal

---

<div class="post-metadata">

**Author:** ![geekpete](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/geekpete/32/20409_2.png) [@geekpete](https://discuss.elastic.co/u/geekpete)\
**Post date:** [July 21, 2017, 6:49am UTC](https://discuss.elastic.co/t/geo-point/93010/2 "2017-07-21T06:49:02Z")

</div>

Hi Tal,

For that location field, you'll want to map it as a geo\_point like this:

```
    "location": {
      "type": "geo_point"
    }

```

So for example:

```
PUT /test-geo/
{
  "mappings": {
    "doc": {
      "properties": {
        "callsign": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "heading": {
          "type": "float"
        },
        "icao24": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "latitde": {
          "type": "float"
        },
        "longitde": {
          "type": "float"
        },
        "on_grond": {
          "type": "boolean"
        },
        "origin_contry": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "sensors": {
          "type": "boolean"
        },
        "time_position": {
          "type": "long"
        },
        "time_velocity": {
          "type": "long"
        },
        "velocity": {
          "type": "float"
        },
        "vertical_rate": {
          "type": "long"
        },
        "location": {
          "type": "geo_point"
        }
      }
    }
  }
}

```

Then that field will be a geo\_point when you index your json into the index, eg:

```
POST /test-geo/doc/
{
  "altitde": 10972.8,
  "callsign": "",
  "heading": 191.74,
  "icao24": "842194",
  "latitde": 36.666,
  "longitde": 35.222,
  "on_grond": true,
  "origin_contry": "Japan",
  "sensors": false,
  "time_position": 0,
  "time_velocity": 1499164181,
  "velocity": 199.67,
  "vertical_rate": 0,
  "location": [
    40.0233,
    80.3336
  ]
}
```

---

<div class="post-metadata">

**Author:** ![Tals](https://avatars.discourse-cdn.com/v4/letter/t/f1d935/32.png) [@Tals](https://discuss.elastic.co/u/Tals)\
**Post date:** [August 6, 2017, 12:33pm UTC](https://discuss.elastic.co/t/geo-point/93010/3 "2017-08-06T12:33:00Z")

</div>

Hi Peter  
Thanks a lot.  
It works !!

---

<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 3, 2017, 12:33pm UTC](https://discuss.elastic.co/t/geo-point/93010/4 "2017-09-03T12:33:10Z")

</div>

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