<br><br><div class="gmail_quote">On Wed, Feb 8, 2012 at 10:29 PM, David Zwarg <span dir="ltr"><<a href="mailto:dzwarg%2Bpostgis@azavea.com">dzwarg+postgis@azavea.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello Bryce,<br><br>I dug through your git repository and nabbed out the st_geotransform methods, put them in core and rt_pg. I replaced the rt_rotation test and expected output with the values that you provided. I'm not sure if this also resolves the preservation of the angle between the basis vectors -- does that feature rely on something else, or is it all included in the geotransform code that you had in your repo?<br>
</blockquote><div><br>Sorry for the delay. All is included. The "magic" is in RASTER_setrotation() here:<br><br>    /* preserve all defining characteristics of the grid except for rotation */<br>    rt_raster_get_phys_params(raster, &imag, &jmag, &theta_i, &theta_ij);<br>
    rt_raster_set_phys_params(raster, imag, jmag, rotation, theta_ij);<br><br>"theta_ij" is the angle between the basis vectors, as described on the wiki page. Also, you may want to note in the documentation that "rotation" is an absolute value specifying the angle between the "i" vector and the "x/easting" axis in whatever SRID you're using. It's not an additional rotation over and above whatever the "current" rotation is. If you do want "setrotation" to essentially perform a "rotate 'rotation' degrees relative to however the raster is currently rotated", change the above to:<br>
<br>    /* preserve all defining characteristics of the grid except for rotation */<br>
    rt_raster_get_phys_params(raster, &imag, &jmag, &theta_i, &theta_ij);<br>
    rt_raster_set_phys_params(raster, imag, jmag, rotation+theta_i, theta_ij);<br>
<br>Both are fine with me, as it seems like a kind of arbirary choice as long as the docs make it clear what the function is trying to do.<br><br>As a bonus for all your hard work, it appears that  #1331 can be closed out as a duplicate of #1556.<br>
<br>Good work!<br><br>Bryce<br> <br></div></div>