# How to define X and Y coordinates

**URL:** <https://discuss.elastic.co/t/how-to-define-x-and-y-coordinates/91081>\
**Category:** Elasticsearch\
**Created:** [June 28, 2017, 10:32am UTC](https://discuss.elastic.co/t/how-to-define-x-and-y-coordinates/91081 "2017-06-28T10:32:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![moabbas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moabbas/32/19231_2.png) [@moabbas](https://discuss.elastic.co/u/moabbas)\
**Post date:** [June 28, 2017, 10:32am UTC](https://discuss.elastic.co/t/how-to-define-x-and-y-coordinates/91081/1 "2017-06-28T10:32:29Z")

</div>

I need to define geopoint using X and Y coordinates instead of using lat and lon.

---

<div class="post-metadata">

**Author:** ![Julien](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julien/32/19688_2.png) [@Julien](https://discuss.elastic.co/u/Julien)\
**Post date:** [June 28, 2017, 12:26pm UTC](https://discuss.elastic.co/t/how-to-define-x-and-y-coordinates/91081/2 "2017-06-28T12:26:09Z")

</div>

Can you clarify what would be X and Y in your context? If you trying to place items on a map, then use geopoints and one of the accepted values (if X and Y are some values based on a reference point, then your code would need to convert those values to an actual geo-point)  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-point.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-point.html)  
If your attempt is not related to map/geo-location and you plan on using some kibana visualisation to place data in horizontal and vertical axis. Then the type for your x and y fields would not be a geopoint type and chose another data type (most likely a numeric type, possibly a keyword type if you try to aggregate on some text):  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html)

---

<div class="post-metadata">

**Author:** ![moabbas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moabbas/32/19231_2.png) [@moabbas](https://discuss.elastic.co/u/moabbas)\
**Post date:** [June 28, 2017, 1:04pm UTC](https://discuss.elastic.co/t/how-to-define-x-and-y-coordinates/91081/3 "2017-06-28T13:04:55Z")

</div>

Hello , here is exactly what I have , I want to add a custom tile map for a station , the API sends the X , Y which defines an object on that Map , I have successfully managed to upload the map into Kibana , I'm only struggling with the plotting of the data on the map , kindly note that the x and y are in numeric formats , What do you suggest I should do ??  
{  
"\_index": "logstash-2017.06.15",  
"\_type": "log",  
"\_score": 1,  
"\_source": {  
"@timestamp": "2017-06-28T12:47:50.047Z",  
"lt": {  
"ln": """",  
"lo": 0,  
"bi": null,  
**"px": 384.662567,**  
**"py": 250.399826** ,  
"pz": 0,  
"ap": null,  
"la": 0,  
}

---

<div class="post-metadata">

**Author:** ![Julien](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julien/32/19688_2.png) [@Julien](https://discuss.elastic.co/u/Julien)\
**Post date:** [June 29, 2017, 9:52am UTC](https://discuss.elastic.co/t/how-to-define-x-and-y-coordinates/91081/4 "2017-06-29T09:52:05Z")

</div>

Hi Muhammad,

I am still unsure what those X and Y are though it is clear those are not valid values for longitude or latitude... Valid range for latitude is -90 to +90, and for longitude -180 to +180 ([https://en.wikipedia.org/wiki/Geographic\_coordinate\_system](https://en.wikipedia.org/wiki/Geographic_coordinate_system))

What I would suggest is research what those numbers are on the documentation of the application you use and how you should convert them to latitude and longitude. You can check those numbers outside of elasticsearch to make sure they refer to the correct point on the map : [http://www.latlong.net/Show-Latitude-Longitude.html](http://www.latlong.net/Show-Latitude-Longitude.html)

Also related to uploading a map, in kibana you can just use the Tile Map visualisation and you would not upload any map.  
Thanks - Julien

---

<div class="post-metadata">

**Author:** ![moabbas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moabbas/32/19231_2.png) [@moabbas](https://discuss.elastic.co/u/moabbas)\
**Post date:** [July 2, 2017, 7:30am UTC](https://discuss.elastic.co/t/how-to-define-x-and-y-coordinates/91081/5 "2017-07-02T07:30:11Z")

</div>

Hi Julien,  
What i mean with X and Y are the Cartesian coordinates X axis and Y axis.  
Thanks,  
Muhammad

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 2, 2017, 8:43am UTC](https://discuss.elastic.co/t/how-to-define-x-and-y-coordinates/91081/6 "2017-07-02T08:43:49Z")

</div>

In order to plot your data on a standard map, you need to convert your cartesian coordinates into latitude and longitude. If you are looking to plot this data on a custom map using these coordinates, the following [blog post](https://www.elastic.co/blog/operational-analytics-with-elasticsearch-at-elasticon-2017-part-2) may be of interest.

---

<div class="post-metadata">

**Author:** ![moabbas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moabbas/32/19231_2.png) [@moabbas](https://discuss.elastic.co/u/moabbas)\
**Post date:** [July 2, 2017, 10:25am UTC](https://discuss.elastic.co/t/how-to-define-x-and-y-coordinates/91081/7 "2017-07-02T10:25:15Z")

</div>

Okay, Thanks 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:** [July 30, 2017, 10:25am UTC](https://discuss.elastic.co/t/how-to-define-x-and-y-coordinates/91081/8 "2017-07-30T10:25:16Z")

</div>

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