Opened 11 years ago

Last modified 5 years ago

#2571 new patch

Create version of ST_RotateY with pointOrigin like ST_Rotate()

Reported by: smathermather Owned by: robe
Priority: medium Milestone: PostGIS Fund Me
Component: postgis Version: master
Keywords: Cc:

Description

geometry ST_RotateY(geometry geomA, float rotRadians, geometry pointOrigin)

— Function: ST_RotateY(geometry, double precision, geometry) CREATE OR REPLACE FUNCTION ST_RotateY(geomA geometry, rotRadians double precision, pointOrigin geometry)

RETURNS geometry AS

$BODY$

— Transform geometry to nullsville (0,0,0) so rotRadians will take place around the pointOrigin WITH transformed AS (

SELECT ST_Translate(geomA, -1 * ST_X(pointOrigin), -1 * ST_Y(pointOrigin), -1 * ST_Z(pointOrigin)) AS the_geom ),

— Rotate in place rotated AS (

SELECT ST_RotateY(the_geom, rotRadians) AS the_geom FROM transformed ),

— Translate back home rotTrans AS (

SELECT ST_Translate(the_geom, ST_X(pointOrigin), ST_Y(pointOrigin), ST_Z(pointOrigin)) AS the_geom

FROM rotated

)

— profit SELECT the_geom from rotTrans

;

$BODY$

LANGUAGE sql VOLATILE COST 100;

Attachments (1)

ST_RotateY.sql (810 bytes ) - added by smathermather 11 years ago.

Download all attachments as: .zip

Change History (12)

by smathermather, 11 years ago

Attachment: ST_RotateY.sql added

comment:1 by robe, 11 years ago

Milestone: PostGIS 2.1.2PostGIS 2.2.0

comment:2 by pramsey, 10 years ago

Owner: changed from pramsey to robe

Assigning the SQL / API ticket to Regina :)

comment:3 by pramsey, 9 years ago

Milestone: PostGIS 2.2.0PostGIS Future

comment:4 by pramsey, 9 years ago

Milestone: PostGIS FuturePostGIS 2.2.0

comment:5 by robe, 9 years ago

Milestone: PostGIS 2.2.0PostGIS 2.3.0

comment:6 by robe, 8 years ago

Milestone: PostGIS 2.3.0PostGIS 2.4.0

Given that this patch doesn't include documentation and I think some things in the related functions have changed that would make this code easier, I'm pushing this to 2.4 consideration. I want to release 2.3 very soon.

comment:7 by robe, 7 years ago

Milestone: PostGIS 2.4.0PostGIS 2.5.0

comment:8 by robe, 7 years ago

smathermather,

rework this patch as a C function.

comment:9 by robe, 6 years ago

Milestone: PostGIS 2.5.0PostGIS next

comment:10 by robe, 6 years ago

Milestone: PostGIS nextPostGIS 3.0.0

Milestone renamed

comment:11 by Algunenano, 5 years ago

Milestone: PostGIS 3.0.0PostGIS Fund Me
Version: 2.1.xtrunk
Note: See TracTickets for help on using tickets.