How to generate a pie chart from geo_points within a geo_shape in ELK?

Hello everyone! I have created a map by importing GEOJSON data in KIBANA.

The data is indexed as geo_shape and it contains the World's territorial waters area. It represents a layer in my map. I have then added another layer, always using GEOJSON, containing geo_points representing the gps data of a yacht charter:

Now, in my dashboard, I would like to show a pie chart, indicating the percentage of time spent by the yacht during this charter outside of the territorial waters, but I am unable to understand how to do that.

You can see the GEOJSON file here: Charter Trip GeoJSON

I generated it from a CSV file.

Here you can see the territorial waters Territorial Waters GeoJSONhttp://84.33.95.3:81/eez_12nm.json

I was thinking to use the geo_shape created by the territorial waters as boundaries, then I would add a layer for each charter trip and I need to output the percentage of time spent outside of the boundaries for VAT calculation purposes, I do not really need to know the yacht's name, but rather how much time a single boat has spent outside of territorial waters (in percentage).

Any help would be really really appreciated!

You can use enrich ingest processor to enrich your point locations with field indicating whether the points are outside of territorial waters (https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-match-enrich-policy-type.html). Then, you can use this new field to create the desired pie chart.

Thanks @Nathan_Reese! Will give it a try later on today and post the outcome here!

Hello again everyone! So, I went a bit further, but not so much unfortunately, and I am still stuck.

I managed to ingest AIS positions as geo points from API requests using Logstash pipelines and mutate filters, I get the yachts positions on my map, which has a layer containing the geo shapes of the World's territorial waters, but I am still unable to understand how to generate charts based upon the time spent by a vessel outside (or inside) the territorial waters.

I have learned a lot on how to generate geo points etc., but I am now really desperate to find a solution on how to have a percentage of time spent by the yachts outside of the geo shapes...

I tried to use @Nathan_Reese solution, but with no chance, where am I mistaking?

Thanks!

I am reading (but not understanding...), this:

I now created and executed the Enrich policy:

    PUT /_enrich/policy/within_tw_policy
    
      "geo_match": {
        "indices": "territorial-waters-def",
        "match_field": "coordinates",
        "enrich_fields": [ "coordinates", "location"]
      }
    }

POST /_enrich/policy/within_tw_policy/_execute

Then I added the Enrich processor to the ingest pipeline "queen-elizabeth-pipeline" that contains the geo points (the index "territorial-waters-def" contains the geo shapes that define the territorial waters). I just don't get what I need to to next...

I am really lost... How to index data through a pipeline? I removed and re-created the index "queen-elizabeth" and the pipeline I created was overwritten....

I am really lost, I do not understand how I can do that, I tried everything I could find, but I am getting nowhere

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