Opened 11 years ago
Last modified 7 years ago
#2570 new patch
Create version of ST_RotateX with pointOrigin like ST_Rotate()
Reported by: | smathermather | Owned by: | robe |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS Fund Me |
Component: | postgis | Version: | 2.1.x |
Keywords: | Cc: |
Description
geometry ST_RotateX(geometry geomA, float rotRadians, geometry pointOrigin)
— Function: st_rotatex(geometry, double precision, geometry) CREATE OR REPLACE FUNCTION ST_RotateX(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_RotateX(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)
Change History (7)
by , 11 years ago
Attachment: | ST_RotateX.sql added |
---|
comment:1 by , 11 years ago
Milestone: | PostGIS 2.1.2 → PostGIS 2.2.0 |
---|
comment:2 by , 10 years ago
Owner: | changed from | to
---|
comment:3 by , 9 years ago
Milestone: | PostGIS 2.2.0 → PostGIS Future |
---|
comment:4 by , 9 years ago
Milestone: | PostGIS Future → PostGIS 2.2.0 |
---|
comment:5 by , 9 years ago
Milestone: | PostGIS 2.2.0 → PostGIS Future |
---|
hye why did you change this to 2.2, I thought we said no more api changes? only bugs should be dealt with moving forward?
Assigning the SQL / API ticket to Regina