Check if vehicle is driving on water

Hi,

I have map with vehicles, some times i have an error with position data and i want to check if some of vehicle is not driving on water, if yes get an alert. How can i do it ?

That is a very interesting case. This should be possible with a geo_shape query.

Here's how I would do this.

  1. Index your vehicle position data as a geo_shape field.
  2. In a separate index, add a geo_shape polygon for land (not water) areas.
  3. Create a Watch with a Search input using a geo_shape query pre-indexed shape to find positions that are within the land geo_shape polygon.
  4. Add a condition to the Watch to alert when the results are greater than zero.
  5. Add a trigger and an email action to the Watch.
3 Likes

Need i map my vehicle position to geo_shape ? I have maped it to geo_point and if it is not necessery i don't want to change it.

Yes, but only if you want to use a pre-indexed shape for the query. the geo_polygon query, which works with geo_points, does not yet support pre-indexed shapes. There is a feature request for this here. https://github.com/elastic/elasticsearch/issues/46730

I think it may be possible to use the geo_polygon query with your geo_points if you pass a static polygon in the query. But your query may be very large if you have a polygon with many coordinates.

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