[postgis-devel] [PostGIS] #1331: [raster] Physically relevant geotransform settings

PostGIS trac at osgeo.org
Wed Dec 7 11:36:30 PST 2011


#1331: [raster] Physically relevant geotransform settings
----------------------------+-----------------------------------------------
 Reporter:  bnordgren       |       Owner:  pracine              
     Type:  enhancement     |      Status:  new                  
 Priority:  medium          |   Milestone:  PostGIS Raster Future
Component:  postgis raster  |     Version:  trunk                
 Keywords:                  |  
----------------------------+-----------------------------------------------
Changes (by bnordgren):

  * version:  1.5.X => trunk


Comment:

 The implementation in my git repo is now exposed to the SQL interface.
 This includes:

  * A new type (`geotransform`)
  * A getter (`ST_Getgeotransform`)
  * Two setter variants (`ST_setgeotransform`)

 The type :

 {{{
 CREATE TYPE geotransform AS (
         imag     double precision,
         jmag     double precision,
         theta_i  double precision,
         theta_ij double precision,
         xoffset  double precision,
         yoffset  double precision) ;
 }}}


 The getter signature:

 {{{
 ST_GetGeotransform(raster) -> geotransform
 }}}

 The setter signatures:

 {{{
 ST_SetGeotransform(rast raster,
                 imag double precision, jmag double precision,
                 theta_i double precision, theta_ij double precision,
                 xoffset double precision, yoffset double precision) ->
 raster

 ST_SetGeotransform(rast raster, gt geotransform) -> raster

 }}}

 These terms are consistent with the wiki pages, but not necessarily with
 the other accessors.

  * theta_i has been referred to as "rotation"
  * imag has been referred to as "pixelwidth"
  * jmag has been referred to as "pixelheight"

 The current terms for the last two are only intuitive if theta_i=0; and
 they mean exactly the opposite of the intuitive sense if theta_i= +-pi/2
 (e.g., width is height and vice versa. However, imag and jmag ''always''
 represent the pixel length along the i and j axes, respectively.)

 xoffset and yoffset specify the location of the origin (i,j)=(0,0). This
 is identical to the upper left corner if and only if theta_i=0 and
 theta_ij=-pi/2. Otherwise, it could be any of the other three corners of
 the raster.

 I'm flexible on the terminology, but whatever is chosen should be
 meticulously docmented, probably in the "raster best practices" section
 suggested by robe. Reasonable defaults could also be provided.

 https://github.com/bnordgren/postgis/tree/ri-gen2-svn

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1331#comment:3>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-devel mailing list