[postgis-devel] [PostGIS] #1639: [raster] MapAlgebraExpr can't handle conditions

PostGIS trac at osgeo.org
Fri Mar 2 02:40:36 PST 2012


#1639: [raster] MapAlgebraExpr can't handle conditions
---------------------+------------------------------------------------------
 Reporter:  nicklas  |       Owner:  pracine      
     Type:  defect   |      Status:  new          
 Priority:  high     |   Milestone:  PostGIS 2.0.0
Component:  raster   |     Version:  trunk        
 Keywords:           |  
---------------------+------------------------------------------------------

Comment(by nicklas):

 Great Pierre

 almost there

 First 1-raster version is still not working as I understand dustymugs
 comments above.


 Second:

 You are right I misunderstood things, but still, the casts doesn't make
 sense.

 If I cast to Integer and put it in '8BSI' like this:


 {{{
 WITH foo AS (
         SELECT
                 ST_MapAlgebraExpr(a.rast, b.rast, '(([rast1]-[rast2]) >
 5)::int', '8BSI') AS rast
         FROM test_mapalgebra a
         CROSS JOIN test_mapalgebra b
         WHERE a.rid = 1
                 AND b.rid = 2
 )
 SELECT
         (ST_BandMetadata(rast)).*,
         (ST_SummaryStats(rast)).*
 FROM foo;
 }}}

 Then I would expect the false results to show as 0, right?

 But I still get the same result (nodata as I have learned now :-) )



 I also wonder if something is wrong because of performance. I am using
 this expressions to find clear cuttings (I will give a PostGIS talk next
 week and will show the functionality)

 To do this calculation in PostGIS it takes about 45 seconds, but in QGIS
 with the same images as geotiff it takes less than 2 seconds.

 But it can be because PostGIS can't gain fully from the SATA3 ssd on this
 box while maybe the file based  gdal calculation through QGIS can?

 Or is it some casts that is giving a false bottleneck?

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1639#comment:14>
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