Changes between Version 61 and Version 62 of WKTRasterTutorial01
- Timestamp:
- 06/15/10 12:30:25 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TabularUnified WKTRasterTutorial01
v61 v62 134 134 {{{ 135 135 SELECT (md).*, (bmd).* 136 FROM (SELECT ST_Metadata(rast) md,137 ST_BandMetadata(rast) bmd136 FROM (SELECT ST_Metadata(rast) AS md, 137 ST_BandMetadata(rast) AS bmd 138 138 FROM srtm_tiled LIMIT 1 139 139 ) foo; … … 242 242 {{{ 243 243 CREATE TABLE cariboupoints AS 244 SELECT generate_series(1, 814) id,245 ST_Transform(ST_RandomPoints(the_geom, 814), 32198) the_geom246 FROM (SELECT ST_SetSRID(ST_Extent(rast::geometry), 4326) the_geom244 SELECT generate_series(1, 814) AS id, 245 ST_Transform(ST_RandomPoints(the_geom, 814), 32198) AS the_geom 246 FROM (SELECT ST_SetSRID(ST_Extent(rast::geometry), 4326) AS the_geom 247 247 FROM srtm_tiled 248 248 ) foo; … … 266 266 {{{ 267 267 CREATE TABLE cariboupoint_buffers AS 268 SELECT id, ST_Buffer(the_geom, 1000) the_geom268 SELECT id, ST_Buffer(the_geom, 1000) AS the_geom 269 269 FROM cariboupoints; 270 270 }}} … … 281 281 {{{ 282 282 CREATE TABLE cariboupoint_buffers_wgs AS 283 SELECT id, ST_Transform(the_geom, 4326) the_geom283 SELECT id, ST_Transform(the_geom, 4326) AS the_geom 284 284 FROM cariboupoint_buffers; 285 285 }}} … … 296 296 {{{ 297 297 CREATE TABLE cariboupoint_buffers_wgs AS 298 SELECT id, ST_Transform(ST_Buffer(the_geom, 1000), 4326) the_geom298 SELECT id, ST_Transform(ST_Buffer(the_geom, 1000), 4326) AS the_geom 299 299 FROM cariboupoints; 300 300 }}} … … 313 313 CREATE TABLE caribou_srtm_inter AS 314 314 SELECT id, 315 (st_intersection(rast, the_geom)).geom the_geom,315 (st_intersection(rast, the_geom)).geom AS the_geom, 316 316 (st_intersection(rast, the_geom)).val 317 317 FROM cariboupoint_buffers_wgs, … … 325 325 CREATE TABLE caribou_srtm_inter AS 326 326 SELECT id, 327 (gv).geom the_geom,327 (gv).geom AS the_geom, 328 328 (gv).val 329 329 FROM (SELECT id, 330 st_intersection(rast, the_geom)gv330 ST_Intersection(rast, the_geom) AS gv 331 331 FROM srtm_tiled, 332 332 cariboupoint_buffers_wgs … … 354 354 CREATE TABLE result01 AS 355 355 SELECT id, 356 sum(st_area(ST_Transform(the_geom, 32198)) * val) / sum(st_area(ST_Transform(the_geom, 32198))) asmeanelev356 sum(st_area(ST_Transform(the_geom, 32198)) * val) / sum(st_area(ST_Transform(the_geom, 32198))) AS meanelev 357 357 FROM caribou_srtm_inter 358 358 GROUP BY id