# Latitude -\> Lat, Longitude -\> lon

**URL:** <https://discuss.elastic.co/t/latitude-lat-longitude-lon/18496>\
**Category:** Elasticsearch\
**Created:** [July 7, 2014, 12:23am UTC](https://discuss.elastic.co/t/latitude-lat-longitude-lon/18496 "2014-07-07T00:23:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olivier\_B](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/olivier_b/32/1422_2.png) [@Olivier\_B](https://discuss.elastic.co/u/Olivier_B)\
**Post date:** [July 7, 2014, 12:23am UTC](https://discuss.elastic.co/t/latitude-lat-longitude-lon/18496/1 "2014-07-07T00:23:43Z")

</div>

Hi there,

I understand a geo-point can be mapped based on two fields : "lat", "long".  
However my fields are name "longitude" and "latitude".  
I'm using the river plugin for couchdb and I cannot really rename those  
fields before indexing. And those fields are part of an item in an array:

"items": [  
{  
"item\_id" : "abcd",  
"location":  
{  
"longitude": 145.7711,  
"latitude": -16.92359  
}  
},  
{  
"item\_id" : "efgh",  
"location":  
{  
"longitude": 149.6611,  
"latitude": -19.94098  
}  
}  
]

So, any idea how I can rename those fields? And eventually map it to a geo  
point  
([http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-geo-point-type.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-geo-point-type.html))?

Cheers

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/96700d4a-c3f5-441a-a53f-dfee9e934364%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/96700d4a-c3f5-441a-a53f-dfee9e934364%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 7, 2014, 6:15am UTC](https://discuss.elastic.co/t/latitude-lat-longitude-lon/18496/2 "2014-07-07T06:15:48Z")

</div>

You could may be try to use script filters and add on the fly lat and lon fields or a String representing your point.

See doc: [https://github.com/elasticsearch/elasticsearch-river-couchdb](https://github.com/elasticsearch/elasticsearch-river-couchdb)

HTH

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 7 juil. 2014 à 02:23, Olivier B [obierlai@gmail.com](mailto:obierlai@gmail.com) a écrit :

Hi there,

I understand a geo-point can be mapped based on two fields : "lat", "long".  
However my fields are name "longitude" and "latitude".  
I'm using the river plugin for couchdb and I cannot really rename those fields before indexing. And those fields are part of an item in an array:

"items": [  
{  
"item\_id" : "abcd",  
"location":  
{  
"longitude": 145.7711,  
"latitude": -16.92359  
}  
},  
{  
"item\_id" : "efgh",  
"location":  
{  
"longitude": 149.6611,  
"latitude": -19.94098  
}  
}  
]

So, any idea how I can rename those fields? And eventually map it to a geo point ([http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-geo-point-type.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-geo-point-type.html))?

Cheers

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/96700d4a-c3f5-441a-a53f-dfee9e934364%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/96700d4a-c3f5-441a-a53f-dfee9e934364%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/6C446501-E0D4-4888-B737-CFE457DE5320%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/6C446501-E0D4-4888-B737-CFE457DE5320%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Olivier\_B](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/olivier_b/32/1422_2.png) [@Olivier\_B](https://discuss.elastic.co/u/Olivier_B)\
**Post date:** [July 7, 2014, 2:42pm UTC](https://discuss.elastic.co/t/latitude-lat-longitude-lon/18496/3 "2014-07-07T14:42:07Z")

</div>

Thanks for your reply.  
I know I tried that, but it's in an array, so Iw ould need to iterate or  
something, because trying to map the path leads to an error if there is an  
array:  
Here, items is an array: ctx.doc.items.location.longitude

That's why i'm looking for an alternative solution.

On Monday, July 7, 2014 4:16:48 PM UTC+10, David Pilato wrote:

> You could may be try to use script filters and add on the fly lat and lon  
> fields or a String representing your point.
> 
> See doc: [GitHub - elastic/elasticsearch-river-couchdb: CouchDB River Plugin for elasticsearch (STOPPED)](https://github.com/elasticsearch/elasticsearch-river-couchdb)
> 
> HTH
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 7 juil. 2014 à 02:23, Olivier B \<[obie...@gmail.com](mailto:obie...@gmail.com) \<javascript:\>\> a  
> écrit :
> 
> Hi there,
> 
> I understand a geo-point can be mapped based on two fields : "lat", "long".  
> However my fields are name "longitude" and "latitude".  
> I'm using the river plugin for couchdb and I cannot really rename those  
> fields before indexing. And those fields are part of an item in an array:
> 
> "items": [  
> {  
> "item\_id" : "abcd",  
> "location":  
> {  
> "longitude": 145.7711,  
> "latitude": -16.92359  
> }  
> },  
> {  
> "item\_id" : "efgh",  
> "location":  
> {  
> "longitude": 149.6611,  
> "latitude": -19.94098  
> }  
> }  
> ]
> 
> So, any idea how I can rename those fields? And eventually map it to a geo  
> point (  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-geo-point-type.html)  
> )?
> 
> Cheers
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/96700d4a-c3f5-441a-a53f-dfee9e934364%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/96700d4a-c3f5-441a-a53f-dfee9e934364%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/96700d4a-c3f5-441a-a53f-dfee9e934364%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/96700d4a-c3f5-441a-a53f-dfee9e934364%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e2c23a9d-d901-49d6-8dfb-d8f9d501c766%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e2c23a9d-d901-49d6-8dfb-d8f9d501c766%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 1:17am UTC](https://discuss.elastic.co/t/latitude-lat-longitude-lon/18496/4 "2017-07-06T01:17:34Z")

</div>


