My goal is to find all possible "walls" (the parts of the initial polygon boundary) where I have at least x meters clearance.
Here is the full area I'm working with, but heres a short explanation what I'm trying to archive:
I tried to solve my problem by creating a negative buffer with x meters into a (Multi)Polygon. Here I use -1.8 meters for the buffer polygon in red.
I'm re-adding a Buffer with the same x meters. That's the area where I have essentially x meters clearance from the boundary.
and return the boundary of that pink buffer.
After that I want to intersect the new boundary of the buffer with my base boundary of the first area in picture 1. Im essential want to eliminate all boundary parts from the original area where I have not x meters clearance into the area and the parts of the buffer boundary where there is no boundary in the original area.
But there are small differences or the Intersection does not work at all (see last picture).
Is there any better way or adjustments in the buffer creation which makes this more precise or a tool to solve my problem another way?
Here’s another Area from my Polygon, where the intersection fails without any obvious reason. (Yellow is the Boundary of the buffer, Red is where the intersection worked):
Here is the picture of the right side (zoomed in), where intersect doesn't work, as there is a distance between the initial border (blue) and the new one from the negative and positive buffer (yellow):
intersection (
buffer (
buffer ($geometry, -1.8,
join:='miter'),
1.81,
join:='miter'
),
boundary($geometry)
)
With this expression I was able to come as close as possible to my needed solution, when I add a right sided buffer (an inward buffer at the calculated boundaries) of 1.8 meters, I can see that some part of the buffer overlaps out of the polygon (circles I drew) and where the boundary does not extends to its fullest potential (the square):
I'm aware this type of shape might be to complex for a solution with this method.