[postgis-users] ST_Clip

Paolo Cavallini cavallini at faunalia.it
Thu Jul 26 10:54:00 PDT 2012


Il 26/07/2012 19:39, Pierre Racine ha scritto:
> What happen if do a query like this:
>
> SELECT (gv).geom, (gv).val
> FROM (SELECT ST_PixelAsPolygons(ST_AsRaster(ST_Buffer(ST_Centroid(ST_Envelope(rast)), 0.5000), rast, ST_BandPixelType(rast, 1), 1, -1)) gv
>       FROM hdr
>       WHERE rid = 4
> ) foo
>
> and display the resulting geometries labelled with the values?
>
> This is the first step of the clipping: creating a rasterized version of the buffer geometry aligned on the raster.
Here it is (qgis complains that it is not a valid layer, as it misses an
id):
>                                                                                             geom                                                                                                | val 
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----
 0103000020BB0B000001000000050000009D13253B5710384114AE47315EC652419D13253BBB10384114AE47315EC652419D13253BBB10384114AE473145C652419D13253B5710384114AE473145C652419D13253B5710384114AE47315EC65241
|   
 0103000020BB0B000001000000050000009D13253B5710384114AE473145C652419D13253BBB10384114AE473145C652419D13253BBB10384114AE47312CC652419D13253B5710384114AE47312CC652419D13253B5710384114AE473145C65241
|   
 0103000020BB0B000001000000050000009D13253BBB10384114AE47315EC652419D13253B1F11384114AE47315EC652419D13253B1F11384114AE473145C652419D13253BBB10384114AE473145C652419D13253BBB10384114AE47315EC65241
|   
 0103000020BB0B000001000000050000009D13253BBB10384114AE473145C652419D13253B1F11384114AE473145C652419D13253B1F11384114AE47312CC652419D13253BBB10384114AE47312CC652419D13253BBB10384114AE473145C65241
|   
(4 righe)

-- 
Paolo Cavallini - Faunalia
www.faunalia.eu
Full contact details at www.faunalia.eu/pc
Nuovi corsi QGIS e PostGIS: http://www.faunalia.it/calendario




More information about the postgis-users mailing list