Changes between Version 65 and Version 66 of WKTRasterTutorial01


Ignore:
Timestamp:
06/17/10 13:15:28 (15 years ago)
Author:
pracine
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • WKTRasterTutorial01

    v65 v66  
    145145
    146146{{{
    147     SELECT rid, ST_AsBinary(rast::geometry) FROM srtm_tiled;
     147    SELECT rid, ST_AsBinary(rast::geometry)
     148    FROM srtm_tiled;
    148149}}}
    149150
     
    153154
    154155{{{
    155     SELECT ST_AsBinary(ST_Buffer(ST_Union(rast::geometry), 0.000001)) FROM srtm_tiled;
     156    SELECT ST_AsBinary(ST_Buffer(ST_Union(rast::geometry), 0.000001))
     157    FROM srtm_tiled;
    156158}}}
    157159       
     
    161163
    162164{{{
    163     SELECT ST_AsBinary((ST_DumpAsPolygons(rast)).geom), (ST_DumpAsPolygons(rast)).val
     165    SELECT ST_AsBinary((ST_DumpAsPolygons(rast)).geom),
     166           (ST_DumpAsPolygons(rast)).val
    164167    FROM srtm_tiled
    165168    WHERE rid=34;
     
    335338}}}
    336339       
    337 This version takes only 17 minutes. Almost half the time spent by the preceding one... This little increase in complexity certainly worths the gain in performance. The size of the tiles has also a major effect here. If we restart the whole process with 60 pixels x 60 pixels tiles (60 is a divider of 6000) the intersection operation takes 9 minutes. 200 pixels x 200 pixels: 47 minutes...
     340This version takes only 17 minutes. Almost half the time spent by the preceding one... This little increase in complexity certainly worths the gain in performance. The size of the tiles has also a major effect here. If we restart the whole process with 60 pixels x 60 pixels tiles (60 is a divider of 6000) the intersection operation takes 9 minutes. 200 pixels x 200 pixels: 47 minutes... 30 pixels x 30 pixels: 5 minutes. You choose...
    338341
    339342Once again you can visualise the result of the query by doing this query in OpenJUMP (you might have to increase RAM allowed to OpenJUMP by changing "-Xmx256M" to "-Xmx1024M" in "OpenJUMPInstallPath/bin/openjump.bat"):
     
    354357    CREATE TABLE result01 AS
    355358    SELECT id,
    356            sum(st_area(ST_Transform(the_geom, 32198)) * val) / sum(st_area(ST_Transform(the_geom, 32198))) AS meanelev
     359           sum(st_area(ST_Transform(the_geom, 32198)) * val) /
     360           sum(st_area(ST_Transform(the_geom, 32198))) AS meanelev
    357361    FROM caribou_srtm_inter
    358362    GROUP BY id