[postgis-users] use of the affine() function

Martin Davis mbdavis at refractions.net
Mon May 28 13:51:31 PDT 2007


In order to turn a set of [src, dest] coordinate pairs into an affine 
transformation, you have to solve a system of linear equations.  The 
solution is the entries in the require affine transformation matrix.  In 
order to fully determine an affine transformation you need 3 control 
points and their images under the transformation.

I don't know if PostGIS has this functionality available, but if you can 
hack Java (so to speak) JTS provides a class called 
AffineTransformationBuilder which can do this.

Dylan Beaudette wrote:
> I have a problematic TIGER  module - i.e. a single county in Ca is really 
> messed up. I thought that a simple translate() would do the job, but it looks 
> like there is both a translation and rotation involved. I do not really 
> understand the postgis manual entry for the affine function.
>
> How would one go about converting a series of coordinate pairs ([good], [bad]) 
> into the terms of the affine transform matrix?
>
> thanks,
>
>
>
>   

-- 
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022




More information about the postgis-users mailing list