I'm trying to create buffers around polygons with the buffer distance dependent on the size of the polygon. For example, a polygon of <50 hectares would get a buffer of 100m, 51-199 hectares gets a buffer of 200m, and so on. I've been using the Create Buffers tool and trying to use an Expression buffer type. Firstly, I'm not sure if this is the best way to go about this so any advice would be appreciated. Secondly, my expression keeps failing due it not being valid (I'm new to Python).
The code I've been trying to input has been something like:
when($feature.Area_ha <= 50, 100,
($feature.Area_ha >= 51 && <= 199), 200,
($feature.Area_ha >= 200 && <= 299), 300,
($feature.Area_ha >= 300 && <= 399), 400,
$feature.Area_ha >= 400, 500)
If anyone has any advice on improving the code or another method that would be great.
Thanks !