Changes between Version 50 and Version 51 of WKTRaster/SpecificationWorking03
- Timestamp:
- 04/06/11 07:41:33 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WKTRaster/SpecificationWorking03
v50 v51 48 48 nbands is an array of 1-based band indices of the bands to copy into the output raster 49 49 50 Ex: For a raster rast with 3 bands: 51 52 ST_Band(rast, ARRAY[1,3,2]) 53 54 ST_Band(rast, ARRAY[3,2,1]) 55 56 You can rearrange the bands as above. You can also duplicate the bands: 57 58 ST_Band(rast, ARRAY[1,2,3,2,1]) 50 For a raster rast with 3 bands: 51 {{{ 52 ST_Band(rast, ARRAY[1,3,2]) 53 54 ST_Band(rast, ARRAY[3,2,1]) 55 }}} 56 You can rearrange the bands as above. You can also duplicate the bands: 57 {{{ 58 ST_Band(rast, ARRAY[1,2,3,2,1]) 59 }}} 59 60 60 61 ST_Band(rast raster, nband int) -> raster … … 62 63 nband is a single integer of the 1-based band index of the band to copy into the output raster 63 64 64 Ex: ST_Band(rast, 1) 65 66 ST_Band(rast, 3) 65 {{{ 66 ST_Band(rast, 1) 67 68 ST_Band(rast, 3) 69 }}} 67 70 68 71 ST_Band(rast raster, nbands text) -> raster … … 70 73 nbands is a comma separated string of 1-based band indices indicating the bands to copy into the output raster 71 74 72 Ex: ST_Band(rast, '1,2') 73 74 ST_Band(rast, '1,2,3, 1, 1 , 2') 75 {{{ 76 ST_Band(rast, '1,2') 77 78 ST_Band(rast, '1,2,3, 1, 1 , 2') 79 }}} 75 80 76 81 ST_Band(rast raster) -> raster … … 78 83 the band to extract is automatically assumed to be one. 79 84 80 Ex: ST_Band(rast) 85 {{{ 86 ST_Band(rast) 87 }}} 81 88 82 89 If an index is outside the valid range of band indices for a raster (less than 1 or greater than the value returned by ST_NumBands), the function will fail and return. … … 198 205 srs: the user-specified OGC WKT or the proj4 text for a spatial reference to embed in the GDAL raster. Not all formats support embedding this information. e.g. the non-empty value for the srtext or proj4text column from the spatial_ref_sys table. 199 206 200 Ex: ST_AsGDALRaster(rast, 'GTiff', ARRAY['COMPRESS=JPEG', 'JPEG_QUALITY=90'], '+proj=aea +lat_1=34 +lat_2=40.5 +lat_0=0 +lon_0=-120 +x_0=0 +y_0=-4000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs') 201 202 ST_AsGDALRaster(rast, 'GTiff', ARRAY['COMPRESS=JPEG', 'JPEG_QUALITY=90'], 'PROJCS["NAD83 / California Albers",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Albers_Conic_Equal_Area"],PARAMETER["standard_parallel_1",34],PARAMETER["standard_parallel_2",40.5],PARAMETER["latitude_of_center",0],PARAMETER["longitude_of_center",-120],PARAMETER["false_easting",0],PARAMETER["false_northing",-4000000],AUTHORITY["EPSG","3310"],AXIS["X",EAST],AXIS["Y",NORTH]]') 207 {{{ 208 ST_AsGDALRaster(rast, 'GTiff', ARRAY['COMPRESS=JPEG', 'JPEG_QUALITY=90'], '+proj=aea +lat_1=34 +lat_2=40.5 +lat_0=0 +lon_0=-120 +x_0=0 +y_0=-4000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs') 209 210 ST_AsGDALRaster(rast, 'GTiff', ARRAY['COMPRESS=JPEG', 'JPEG_QUALITY=90'], 'PROJCS["NAD83 / California Albers",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Albers_Conic_Equal_Area"],PARAMETER["standard_parallel_1",34],PARAMETER["standard_parallel_2",40.5],PARAMETER["latitude_of_center",0],PARAMETER["longitude_of_center",-120],PARAMETER["false_easting",0],PARAMETER["false_northing",-4000000],AUTHORITY["EPSG","3310"],AXIS["X",EAST],AXIS["Y",NORTH]]') 211 }}} 212 203 213 204 214 ST_AsGDALRaster(rast raster, format text, options text[]) -> bytea … … 206 216 This one removes the user-specified srs argument. The output GDAL raster's spatial reference will be set to the same as the input raster, if possible. 207 217 208 Ex: ST_AsGDALRaster(rast, 'JPEG', ARRAY['QUALITY=50']) 209 210 ST_AsGDALRaster(rast, 'PNG', ARRAY['ZLEVEL=7']) 218 {{{ 219 ST_AsGDALRaster(rast, 'JPEG', ARRAY!['QUALITY=50']) 220 221 ST_AsGDALRaster(rast, 'PNG', ARRAY!['ZLEVEL=7']) 222 }}} 211 223 212 224 ST_AsGDALRaster(rast raster, format text) -> bytea 213 225 214 226 The simplest implementation of this function. Since the options argument has been removed, the output GDAL raster will be created with default options. Like the prior function, the spatial reference of the GDAL raster will be set to the same as the input raster. 227 228 {{{ 229 ST_AsGDALRaster(rast, 'JPEG') 230 }}} 215 231 216 232 ST_AsGDALRaster and other format specific functions (ST_AsJPEG, ST_AsTIFF and ST_AsPNG) are all wrappers around the function