3

I work with QGIS 3.22 and I have a point layer that I want to display as a WMS layer where the actual location of those points would be concealed for security reasons. I have thought that there may be an option to create regular buffers (all of the same size) around those points, but within which the points could be actually placed anywhere. Something like this:

enter image description here

If such a solution would be feasible, only the buffers would be rendered in the final map. Any suggestions to obtain it?

2 Answers 2

6

You can use different expressions such as project() or translate() together with rand() (random integer) or randf() (random float). For example:

with_variable('min',100, -- minimum distance for the random centroid
with_variable('max',1000, -- maximum distance
 buffer(
  project( -- create a new random point within the specified distance
   $geometry, -- take the original point as input
   randf(@min,@max), -- create random distance from input
   radians(
    randf(0,360) -- create random angle 
   )
  )
 ,@max) -- buffer the random point by the specified max distance, so the original point lies within the random buffer
))

This creates a random point within a specified distance (min and max) from the original point and buffers it by the specified max distance.

You can use it as geometry generator symbol or make it a fixed geometry via geometry by expression from processing toolbox.

Keep in mind that when using this as geometry generator the buffers will be recalculated every time you move the canvas. From this behavior one might guess the source of the actual point by just zooming or paning around a little. So to safely hide the real location, I'd rather make the buffers static via geometry by expression. You could also add a random buffersize to hide it even more.

enter image description here

6

Using v.perturb from the processing toolbox on the points you can move the points to a random location within a given distance.

Buffering the resulting points after this would achieve the same the same outcome as described above.

v.perturb interface

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.