Greetings PostGIS devs,<br><br>I'm looking at a couple tickets that I assigned myself from way back when to actually compute the rotation of a raster based on the scale and skew.<br><br>I'm finding some interesting behavior, and I want to know how to proceed:<br>
<br>The 'scale' and 'skew' parameters from the georeference matrix are being handled in a strange way.  When I say strange, I mean:<br><ul><li>The Y scale defaults to 1, when it should default to -1.</li><li>
The Y skew values should be negative in our tests, but they are always positive.</li><li>The scale and skew should both be used to compute the pixel width & height, but currently the pixel width & height are really just synonyms for scale X and scale Y, respectively.</li>
<li>The values returned from rt_raster_get_pixel_width & rt_raster_get_pixel_height tend to be positive in tests, but if we use a real raster with real georeference, rt_raster_get_pixel_height will be negative (since the Y scale is  negative in world files).</li>
<li>Our tests default the raster upper left to 0,0, but then assert coordinate positions based on positive skew and scale values, which really imply a vertical flipping of the raster -- if that is what is being tested, it's not called out, and I think it's a result of the +/- confusion of scale and skew.<br>
</li></ul>In light of these items, and the ramifications they carry through the core api tests, may I propose:<br><ul><li>Width is  computed based on scale & skew?</li><li>We don't call it scaleX and scaleY, but cell_width_x and cell_height_y</li>
<li>We don't call it skewX and skewY, but cell_width_y and cell_height_x</li><li>We separate the accessors for the pixel width and the georeference component that is now used as the width.<br></li><li>Tests assume the upper left coordinate is SMALLER in the X and GREATER in the Y for all other coordinates in the raster -- this would require adjusting our tests to handle the coordinate space uniformly.</li>
</ul>Thoughts? I hope the FOSS4G code sprint is awesome. Wish I could be there.<br>Zwarg<br>