Ticket #1251 (closed enhancement: fixed)

Opened 7 months ago

Last modified 4 months ago

Enhance ST_Rotate by adding offset origin parameters

Reported by: mwtoews Owned by: pramsey
Priority: medium Milestone: PostGIS 2.0.0
Component: postgis Version: trunk
Keywords: Cc:

Description

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

rotate_enhance.diff Download (12.6 KB) - added by mwtoews 7 months ago.
change uninstall order

Change History

Changed 7 months ago by mwtoews

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.

Changed 7 months ago by mwtoews

Note: this change lives on git:  https://github.com/strk/postgis/pull/1

And a unified diff patch for SVN (just add ".diff" to URL):  https://github.com/strk/postgis/pull/1.diff

Changed 7 months ago by mwtoews

change uninstall order

Changed 4 months ago by pramsey

Thanks, into trunk at r9006!

Changed 4 months ago by pramsey

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.