Re: [postgis-users] ST_RotateX with pointOrigin!

2013-12-16 Thread RĂ©mi Cura
Not complaining or whatever, but a truly generic rotation function can be made by using a single ST_Affine call ST_Affine(T^-1. R . T) , where T is the 4-4 translation matrix (id + translation vector on last column), and R is a rotation matrix (possibly a composition of rotation around X,Y,Z. It

Re: [postgis-users] ST_RotateX with pointOrigin!

2013-12-16 Thread Mike Toews
On 15 Dec 2013 21:50, Stephen Mather step...@smathermather.com wrote: Hmm, I know so little about Euler, strike, dip and rake. What are the advantages? Euler angles are very well known, and have a wide range of applications[1]. Strike, dip and rake[2,3] are familiar to any geology student,

Re: [postgis-users] ST_RotateX with pointOrigin!

2013-12-16 Thread Stephen Mather
Simpler often is less flexible. That's the trade-off. You want infinite flexibility, create a matrix, whether affine, Eulerian, from the discipline of geology, or otherwise. Boom, problem solved. Measured/monitored systems often have these parameters as orthogonally bound parameters, e.g.:

Re: [postgis-users] ST_RotateX with pointOrigin!

2013-12-15 Thread Bborie Park
Start in the regress directory found in the root of the postgis source. You'll see that there are always two files for any particular test (MYTEST.sql and MYTEST_expected). To include MYTEST as part of make check, you add MYTEST to regress/Makefile.in -bborie On Sat, Dec 14, 2013 at 10:29 PM,

Re: [postgis-users] ST_RotateX with pointOrigin!

2013-12-15 Thread Stephen Mather
Thanks Bob, That looks like a great resource. Now when will one of my bits of inspiration get permanently etched into a stone bridge? :D Best, Steve On Sun, Dec 15, 2013 at 1:56 AM, Bob and Deb bobd...@gmail.com wrote: So you don't like to do linear algebra? :-) Well, you might be

Re: [postgis-users] ST_RotateX with pointOrigin!

2013-12-15 Thread Stephen Mather
Awesome. I'll take a look. On Sun, Dec 15, 2013 at 1:29 PM, Bborie Park dustym...@gmail.com wrote: Start in the regress directory found in the root of the postgis source. You'll see that there are always two files for any particular test (MYTEST.sql and MYTEST_expected). To include MYTEST

Re: [postgis-users] ST_RotateX with pointOrigin!

2013-12-15 Thread Mike Toews
What do you need to rotate on either X or Y axes? And is it always aligned to either grid directions? I personally see these functions as rather limiting and wouldn't miss them if they vanished. I have thought of developing a better 3d rotate function that is independent of grid X and Y

Re: [postgis-users] ST_RotateX with pointOrigin!

2013-12-15 Thread Stephen Mather
Hmm, I know so little about Euler, strike, dip and rake. What are the advantages? What I do know is that it's easy now to construct a 3 axis rotation function (which also might be better handled with ST_Affine): http://trac.osgeo.org/postgis/attachment/ticket/2575/ -- Function:

[postgis-users] ST_RotateX with pointOrigin!

2013-12-14 Thread Stephen Mather
Hi All, I think I avoided doing linear algebra, which is good since I never studied it... . This is my cludgy patch for making a version of geometry ST_RotateX(geometry geomA, float rotRadians, geometry pointOrigin) It's not pretty enough to be a real patch ('cause my brain couldn't do that

Re: [postgis-users] ST_RotateX with pointOrigin!

2013-12-14 Thread Stephen Mather
Ahem-- bugs fixed: -- 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

Re: [postgis-users] ST_RotateX with pointOrigin!

2013-12-14 Thread Stephen Mather
I have ticketed. It's a little messy of a ticket (actually two), so apologies for that. http://trac.osgeo.org/postgis/ticket/2570 http://trac.osgeo.org/postgis/ticket/2571 I have not yet written any unit tests. Where would I begin... On Sun, Dec 15, 2013 at 1:02 AM, Bborie Park