[postgis-tickets] [PostGIS] #2143: [raster] Width and Height column of raster_columns view may need changing

PostGIS trac at osgeo.org
Sat Dec 8 10:32:20 PST 2012


#2143: [raster] Width and Height column of raster_columns view may need changing
-------------------------+--------------------------------------------------
 Reporter:  dustymugs    |       Owner:  dustymugs    
     Type:  enhancement  |      Status:  new          
 Priority:  medium       |   Milestone:  PostGIS 2.1.0
Component:  raster       |     Version:  trunk        
 Keywords:               |  
-------------------------+--------------------------------------------------

Comment(by pracine):

 A tentative algo to apply the width constraint:

 1) Compute the extent of the whole coverage (fast enough)

 2) Get the width and the height of the tile intersecting the upper left
 corner of the extent (fast if there is an index. There should be one)

 3) Rasterize the extent with the width and the height obtained in 2)
 (fast)

 4) Set the constraint like this:

 ALTER TABLE schemaname.tablename
 ADD CONSTRAINT enforce_width_tablename
 CHECK (st_width(rast) = width AND (st_upperleft(x) !=
 st_rastertoworldcoordx(rasterizedextent, st_width(rasterrisedextent) - 1,
 1)))

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2143#comment:2>
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-tickets mailing list