Changes between Version 61 and Version 62 of WKTRasterTutorial01


Ignore:
Timestamp:
Jun 15, 2010, 12:30:25 PM (12 years ago)
Author:
pracine
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WKTRasterTutorial01

    v61 v62  
    134134{{{
    135135    SELECT (md).*, (bmd).*
    136     FROM (SELECT ST_Metadata(rast) md,
    137                  ST_BandMetadata(rast) bmd
     136    FROM (SELECT ST_Metadata(rast) AS md,
     137                 ST_BandMetadata(rast) AS bmd
    138138          FROM srtm_tiled LIMIT 1
    139139         ) foo;
     
    242242{{{
    243243    CREATE TABLE cariboupoints AS
    244     SELECT generate_series(1, 814) id,
    245            ST_Transform(ST_RandomPoints(the_geom, 814), 32198) the_geom
    246     FROM (SELECT ST_SetSRID(ST_Extent(rast::geometry), 4326) the_geom
     244    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
    247247          FROM srtm_tiled
    248248         ) foo;
     
    266266{{{
    267267    CREATE TABLE cariboupoint_buffers AS
    268     SELECT id, ST_Buffer(the_geom, 1000) the_geom
     268    SELECT id, ST_Buffer(the_geom, 1000) AS the_geom
    269269    FROM cariboupoints;
    270270}}}
     
    281281{{{
    282282    CREATE TABLE cariboupoint_buffers_wgs AS
    283     SELECT id, ST_Transform(the_geom, 4326) the_geom
     283    SELECT id, ST_Transform(the_geom, 4326) AS the_geom
    284284    FROM cariboupoint_buffers;
    285285}}}
     
    296296{{{
    297297    CREATE TABLE cariboupoint_buffers_wgs AS
    298     SELECT id, ST_Transform(ST_Buffer(the_geom, 1000), 4326) the_geom
     298    SELECT id, ST_Transform(ST_Buffer(the_geom, 1000), 4326) AS the_geom
    299299    FROM cariboupoints;
    300300}}}
     
    313313    CREATE TABLE caribou_srtm_inter AS
    314314    SELECT id,
    315         (st_intersection(rast, the_geom)).geom the_geom,
     315        (st_intersection(rast, the_geom)).geom AS the_geom,
    316316        (st_intersection(rast, the_geom)).val
    317317    FROM cariboupoint_buffers_wgs,
     
    325325    CREATE TABLE caribou_srtm_inter AS
    326326    SELECT id,
    327            (gv).geom the_geom,
     327           (gv).geom AS the_geom,
    328328           (gv).val
    329329    FROM (SELECT id,
    330                  st_intersection(rast, the_geom) gv
     330                 ST_Intersection(rast, the_geom) AS gv
    331331          FROM srtm_tiled,
    332332               cariboupoint_buffers_wgs
     
    354354    CREATE TABLE result01 AS
    355355    SELECT id,
    356            sum(st_area(ST_Transform(the_geom, 32198)) * val) / sum(st_area(ST_Transform(the_geom, 32198))) as meanelev
     356           sum(st_area(ST_Transform(the_geom, 32198)) * val) / sum(st_area(ST_Transform(the_geom, 32198))) AS meanelev
    357357    FROM caribou_srtm_inter
    358358    GROUP BY id