Opened 12 years ago

Closed 12 years ago

#1251 closed enhancement (fixed)

Enhance ST_Rotate by adding offset origin parameters

Reported by: Mike Taves Owned by: pramsey
Priority: medium Milestone: PostGIS 2.0.0
Component: postgis Version: master
Keywords: Cc:


Provide ST_Rotate functions that allow offset origin parameters. The current/default rotation behaviour, rotates geometries from the origin POINT(0 0), which has limitations with geographic or UTM coordinates. This enhancement is to allow the reference origin point to be specified as either a POINT geometry or a set of X and Y coordinate values:

ST_Rotate(geometry geomA, float8 rotRadians, float8 x0, float8 y0);
ST_Rotate(geometry geomA, float8 rotRadians, geometry pointOrigin);

Functions, such as ST_MinimumBoundingCircle can be updated to use the new functionality, as it currently uses a more complicate method with multiple subcalls to ST_Affine.

Attachments (1)

rotate_enhance.diff (12.6 KB ) - added by Mike Taves 12 years ago.
change uninstall order

Download all attachments as: .zip

Change History (5)

comment:1 by Mike Taves, 12 years ago

The patch does a few other things, most notably it swaps the synonym for ST_Rotate with ST_RotateZ, so that ST_Rotate can be extended to allow offset origin parameters. It is more intuitive to GIS users that ST_Rotate implies a 2D operation.

The patch also adds missing documentation examples to ST_Rotate, and regress tests are also included.

comment:2 by Mike Taves, 12 years ago

Note: this change lives on git:

And a unified diff patch for SVN (just add ".diff" to URL):

by Mike Taves, 12 years ago

Attachment: rotate_enhance.diff added

change uninstall order

comment:3 by pramsey, 12 years ago

Thanks, into trunk at r9006!

comment:4 by pramsey, 12 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.