Using DirectFunctionCall with more than 9 arguments (LWGEOM_affine)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Using DirectFunctionCall with more than 9 arguments (LWGEOM_affine)

Philip Grimes
Hello all,

I am pretty new to postgis development, and am trying to write some geometric manipulation functions as a c extension for a small performance boost. The problem is that the function I want to call from the C code directly is st_rotate (which is defined by st_affine, or LWGEOM_affine). This function takes in 13 arguments, so I created my own DirectFunctionCall13Coll that was implemented identically to 1-9, however when I run the function with a 0 degree rotation, the return value is a polygon, but the points are of the order of ~e-324, which is much smaller than I was expecting. I wasn't quite sure what I was doing wrong. 

Here is the the input and output of the function. 

NOTICE:  input of LWGEOM_affine
DETAIL:  hull WKT: POLYGON((1 1,1 7,4 8,8 5,1 1))

NOTICE:  Output of func pointer
DETAIL:  rot WKT: POLYGON((4.94065645841247e-324 4.94065645841247e-324,4.94065645841247e-324 3.45845952088873e-323,1.97626258336499e-323 3.95252516672997e-323,3.95252516672997e-323 2.47032822920623e-323,4.94065645841247e-324 4.94065645841247e-324))

And it is called with these arguments, with the macro for the DirectFunctionCall13Coll using the default collation valid. 

DirectFunctionCall13(LWGEOM_affine, hull, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0);

Does anyone have any ideas why this is happening. We are using postgresql 9.2 and postgis 2.0.6.


postgis-devel mailing list
[hidden email]