[postgis-users] generating a random spatial offset

Kevin Neufeld kneufeld at refractions.net
Mon Sep 27 19:51:51 PDT 2010

You could simply have two double precision attribute columns used to 
obfuscate the point geometry.

UPDATE my_point_table
SET deltax = random(), deltay = random();

-- Select an obfuscated point
SELECT ST_Translate(the_geom, deltax, deltay)
FROM my_point_table;

The random() function returns a double between [0,1].  You could of 
course scale this to meet your needs.


On 9/26/2010 10:12 PM, Stephen Cameron wrote:
> Hello,
> Is there a simple means of generating a random spatial offset 
> (Vector?) for obfuscating the position of a point?
> I imagine this offset could be stored in one spatial column and then 
> added to a real point in another column to move its position by the 
> offset.
> Points for which no 'obfuscation' is needed would have a zero offset 
> value.
> Another means might be to reduce the horizontal accuracy of the point, 
> this might be the simplest means if all points could be treated the 
> same way, but this is not possible.

More information about the postgis-users mailing list