In shapely i wanna draw a movement profile of a person. While the person moves through the area, it “discovers” its environment step by step. I use a buffer to model this in shapely.

So basically, at the moment its a LineString with a Buffer.

However, i wanna know, how efficiently the person did its discovery process. Therefore, the self-overlapping area of the developed LineString buffer is very interesting.

The more often a buffer overlaps itself, the more inefficient it is. With this i wanna simulate different movement profiles and compare them with each other.

Now to the question: I found somewhere how to find the intersecting points of the LineString, but for the buffer, i did not find anything. Especially when the buffer is from the same LineString object and are not two ore more different objects

How can this (efficiently) be done with shapely?

I would be good to have something like:

  • the area of the self overlapping buffer
  • how often the buffer overlaps itself at this point (represents: the person “visited” this area n times)
  • nice to have: a heat map where the most overlapping places are for example red and less overlapping is yellow and no overlapping is green

Any ideas?