# I have latitude and longitude separate fields without any wrapper(like location), how do I define "geo\_point" data type

**URL:** <https://discuss.elastic.co/t/i-have-latitude-and-longitude-separate-fields-without-any-wrapper-like-location-how-do-i-define-geo-point-data-type/54678>\
**Category:** Elasticsearch\
**Created:** [July 4, 2016, 11:53pm UTC](https://discuss.elastic.co/t/i-have-latitude-and-longitude-separate-fields-without-any-wrapper-like-location-how-do-i-define-geo-point-data-type/54678 "2016-07-04T23:53:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sabiriqbal](https://avatars.discourse-cdn.com/v4/letter/s/e56c9b/32.png) [@sabiriqbal](https://discuss.elastic.co/u/sabiriqbal)\
**Post date:** [July 4, 2016, 11:53pm UTC](https://discuss.elastic.co/t/i-have-latitude-and-longitude-separate-fields-without-any-wrapper-like-location-how-do-i-define-geo-point-data-type/54678/1 "2016-07-04T23:53:35Z")

</div>

Here is my json.  
{  
"app\_id": "5647",  
"contacts": [  
{  
"first\_name": "Sabir",  
"last\_name": "Iqbal"  
}  
],  
"latitude": 44.669365,  
"longitude": -73.44533  
}

Here is my mapping.

{  
"settings": {  
"number\_of\_shards": 1,  
"number\_of\_replicas": 1  
},  
"mappings": {  
"myType": {  
"properties": {  
"app\_id": { "type": "string" },  
// want to define "geo\_point" for latitude and longitude fields ???????  
}  
}  
}  
}

Please help me out to define geo\_point. I am suing Elasticsearch 2.3.3

---

<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:** [July 5, 2016, 5:21am UTC](https://discuss.elastic.co/t/i-have-latitude-and-longitude-separate-fields-without-any-wrapper-like-location-how-do-i-define-geo-point-data-type/54678/2 "2016-07-05T05:21:26Z")

</div>

You can't.

You need to transform your documents before indexing them,

In 5.0, you will be able to use ingest feature to do that.

---

<div class="post-metadata">

**Author:** ![sabiriqbal](https://avatars.discourse-cdn.com/v4/letter/s/e56c9b/32.png) [@sabiriqbal](https://discuss.elastic.co/u/sabiriqbal)\
**Post date:** [July 5, 2016, 5:38am UTC](https://discuss.elastic.co/t/i-have-latitude-and-longitude-separate-fields-without-any-wrapper-like-location-how-do-i-define-geo-point-data-type/54678/3 "2016-07-05T05:38:15Z")

</div>

Thanks for your quick reply. I appreciate your time and help. Is there any other way to do that? My document is huge it has almost 30 fields. and in a single json file I have 1million data. its quite impossible to transform the document because transformer java class getting OutOfMemmoryError.

---

<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:** [July 5, 2016, 7:13am UTC](https://discuss.elastic.co/t/i-have-latitude-and-longitude-separate-fields-without-any-wrapper-like-location-how-do-i-define-geo-point-data-type/54678/4 "2016-07-05T07:13:46Z")

</div>

Are you saying that a single elasticsearch document contains 1 million data?  
Or did you mean that you have a bulk file which contains 1 million of individual JSON docs?

BTW you can have a look at Logstash to parse and transform your source file to something else.

---

<div class="post-metadata">

**Author:** ![sabiriqbal](https://avatars.discourse-cdn.com/v4/letter/s/e56c9b/32.png) [@sabiriqbal](https://discuss.elastic.co/u/sabiriqbal)\
**Post date:** [July 5, 2016, 2:18pm UTC](https://discuss.elastic.co/t/i-have-latitude-and-longitude-separate-fields-without-any-wrapper-like-location-how-do-i-define-geo-point-data-type/54678/5 "2016-07-05T14:18:48Z")

</div>

I have one json file size of 3.4GB with 1 million line separated document. And the format of the file does not support by Elasticsearch bulk load.

---

<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:** [July 5, 2016, 2:19pm UTC](https://discuss.elastic.co/t/i-have-latitude-and-longitude-separate-fields-without-any-wrapper-like-location-how-do-i-define-geo-point-data-type/54678/6 "2016-07-05T14:19:43Z")

</div>

How are you going to send that to 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:** [July 5, 2017, 10:37pm UTC](https://discuss.elastic.co/t/i-have-latitude-and-longitude-separate-fields-without-any-wrapper-like-location-how-do-i-define-geo-point-data-type/54678/7 "2017-07-05T22:37:57Z")

</div>


