How to define X and Y coordinates

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

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
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

1 Like

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,
}

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)

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

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

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

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 may be of interest.

1 Like

Okay, Thanks it works

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