I have an API which has Ship data and I’m extracting the data using python for 1 hour. The data I extract is in form given below
[{'Timestamp': '2024-04-30T22:06:27.124502+00:00',
'ShipId': 367162320,
'Location': {'long': -87.62471833333333, 'lat': 41.889201666666665},
'SpeedOverGround': 0,
'ShipName': 'WENDELLA'},
{'Timestamp': '2024-04-30T22:07:14.240821+00:00',
'ShipId': 367199310,
'Location': {'long': -118.19945833333333, 'lat': 33.763063333333335},
'SpeedOverGround': 0,
'ShipName': 'CATALINA JET '},
{'Timestamp': '2024-04-30T22:07:27.191644+00:00',
'ShipId': 367162320,
'Location': {'long': -87.624715, 'lat': 41.88918666666667},
'SpeedOverGround': 0,
'ShipName': 'WENDELLA'}]
I am using ElasticSearch client to send the data giving a new mapping for Location as geo_point and using a primary_key for each record to have a unique identifier, I send the index to elasticsearch through which I can create data views and also plot them on a map. Now, the thing is I want the points to connect with respect to timestamp for each ship to know the 1 hour trajectory of the ship. I cannot for my life get the points to connect. The reference Geo-line aggregation apparently shows how to get the points to connect with a line. I tried using the mapping in the PUT test given but to no avail. Any Help?
{
"mappings": {
"properties": {
"my_location": { "type": "geo_point" },
"group": { "type": "keyword" },
"@timestamp": { "type": "date" }
}
}
}