Changes between Version 65 and Version 66 of WKTRasterTutorial01
- Timestamp:
- 06/17/10 13:15:28 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WKTRasterTutorial01
v65 v66 145 145 146 146 {{{ 147 SELECT rid, ST_AsBinary(rast::geometry) FROM srtm_tiled; 147 SELECT rid, ST_AsBinary(rast::geometry) 148 FROM srtm_tiled; 148 149 }}} 149 150 … … 153 154 154 155 {{{ 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; 156 158 }}} 157 159 … … 161 163 162 164 {{{ 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 164 167 FROM srtm_tiled 165 168 WHERE rid=34; … … 335 338 }}} 336 339 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... 340 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... 30 pixels x 30 pixels: 5 minutes. You choose... 338 341 339 342 Once 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"): … … 354 357 CREATE TABLE result01 AS 355 358 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 357 361 FROM caribou_srtm_inter 358 362 GROUP BY id