Opened 10 years ago

Last modified 6 years ago

#687 new enhancement

Affine transformation functions

Reported by: Mike Taves Owned by: geos-devel@…
Priority: major Milestone: GEOS Fund Me
Component: Default Version:
Severity: Feature Request Keywords:
Cc: mloskot

Description

This is a feature request to apply a 2D or 3D affine transformation to a geometry. The routine should ideally be applied in-place, only changing the values of the vertices.

There are several implementations of the affine transform, including shapely.affinity and PostGIS (e.g. here and here).

Derived functions, such as "rotate", "scale", "transform" and "skew" can be build by client applications by assembling the appropriate matrix parameters. As for the function signature, I think the best approach would be to keep the same matrix order of [a, b, d, e, xoff, yoff] for 2D and [a, b, c, d, e, f, g, h, i, xoff, yoff, zoff] for 3D. Whether or not these should be fed into a single function as either a 6 or 12-length double array, or as two functions with fixed arguments is debatable.

Change History (5)

comment:1 by Mike Taves, 10 years ago

And of course there is a JTS AffineTransformation Class, which seems the ideal way to define how this should be defined in GEOS.

comment:2 by strk, 9 years ago

This might help QGIS handling of rotation: http://hub.qgis.org/issues/11814

comment:3 by mloskot, 7 years ago

Cc: mloskot added

comment:4 by mloskot, 7 years ago

@mwtoews Grab JTS sources and start scratching re-write of their AffineTransformationBuilder from Java to C++

https://gist.github.com/guziy/1356654/75434783be64cd35a72d540ec244d8de4d13554d

Submit a patch against trunk, even if half-baked implementation then we can continue improving it.

comment:5 by robe, 6 years ago

Milestone: GEOS FutureGEOS Fund Me

Milestone renamed

Note: See TracTickets for help on using tickets.