Changes between Version 24 and Version 25 of WKTRaster/SpecificationWorking03


Ignore:
Timestamp:
Sep 17, 2010, 8:57:59 AM (14 years ago)
Author:
pracine
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • WKTRaster/SpecificationWorking03

    v24 v25  
    1313}}}
    1414----
    15 == '''Objective B03a - Being able to intersect two raster to get a raster.''' ==
    16  
    17 '''ST_Intersection(raster, integer, raster, integer) -> raster''' - Returns a two bands raster with values only in the intersecting areas of both rasters. Integer parameters are the band number of the raster.
    18 
    19  '''Variants'''
    20 
    21   1) ST_Intersection(raster, integer, raster, integer) -> raster -- the integer parameters are the band number of the rasters[[BR]]
    22   2) ST_Intersection(raster, raster, integer) -> raster -- default first raster to band # 1[[BR]]
    23   3) ST_Intersection(raster, integer, raster) -> raster -- default second raster to band # 1[[BR]]
    24   4) ST_Intersection(raster, raster) -> raster -- default both rasters to band # 1
    25 
    26 ----
    27 == '''Objective B03b - Being able to intersect two raster to get a geometry.''' ==
    28  
    29 '''ST_Intersection(raster, integer, raster, integer, 'geometry') -> geometry''' - Returns a two bands raster with values only in the intersecting areas of both rasters. Integer parameters are the band number of the raster.
    30 
    31 
    32  '''Variants'''
    33 
    34   1) ST_Intersection(raster, integer, raster, integer, 'geometry') -> geometry[[BR]]
    35   2) ST_Intersection(raster, raster, integer, 'geometry') -> geometry -- default first raster to band # 1[[BR]]
    36   3) ST_Intersection(raster, integer, raster, 'geometry') -> geometry -- default second raster to band # 1[[BR]]
    37   4) ST_Intersection(raster, raster, 'geometry') -> geometry -- default both raster to band # 1
    38 
    39 ----
    40 == '''Objective B03c - Being able to reproject a raster.''' ==
     15== '''Objective 02 - Being able to intersect vector and raster to produce raster.''' ==
     16 
     17
     18'''ST_Intersects(raster, raster)'''[[BR]]
     19'''ST_AsRaster(geometry, pixelsize) -> raster'''[[BR]]
     20'''ST_Intersection(geometry, val, raster, band) -> raster'''
     21
     22 The first series of variant return a raster having the same extent as the provided raster.
     23
     24  Variant 1: ST_Intersection(geometry, val, raster, band, pixeltype, nodatavalue) -> raster
     25
     26  Variant 2: ST_Intersection(raster, band, geometry, val, pixeltype, nodatavalue) -> raster
     27
     28  Variant 3: ST_Intersection(geometry, val, raster, pixeltype, nodatavalue) -> raster
     29
     30  Variant 4: ST_Intersection(raster, geometry, val, pixeltype, nodatavalue) -> raster
     31
     32 The second series of variant return a raster having the minimal extent.
     33
     34  Variant 5: ST_Intersection(geometry, val, raster, band, pixeltype, nodatavalue, 'TRIM') -> raster
     35
     36  Variant 6: ST_Intersection(raster, band, geometry, val, pixeltype, nodatavalue, 'TRIM') -> raster
     37
     38  Variant 7: ST_Intersection(geometry, val, raster, pixeltype, nodatavalue, 'TRIM') -> raster
     39
     40  Variant 8: ST_Intersection(raster, geometry, val, pixeltype, nodatavalue, 'TRIM') -> raster
     41
     42 Returns a two bands raster the first band containing only the pixels from the provided raster intersecting with the geometry and the second band containing the same area filled with the provided value.
     43
     44 The second band gets its pixeltype and nodatavalue from the parameters.
     45
     46 Non intersecting pixels are filled with nodata values.
     47
     48 Variant 1 return a raster having the same extent as the provided raster.
     49
     50 Variant 3, 4, 7 and 8 defaults the band number to 1.
     51
     52 Variant 5 to 8 "trim" or "crop" the raster to the withvalue extent (removing extra nodata value pixels surrounding the extent of the resulting withvalue extent).
     53
     54 
     55 '''Open question'''
     56
     57 PR: Shoud we return one raster per raster/geometry couple or split the raster into as many small rasters as there are areas sharing a same value? The second behavior seems more coherent with the present behavior of ST_Intersection(raster, geometry) -> geometry even if this would produce tons of small two bands rasters.
     58
     59 '''Implementation details'''
     60
     61 Rasterize the geometry as a new raster (ST_AsRaster(geometry, pixeltype, val, nodataval, raster)) and then copy only pixels for which both raster bands have a value.
     62 Should be implemented as a wrapper around ST_MapAlgebra after rasterizing the geometry to a raster having the same alignment as the raster.
     63
     64----
     65== '''Objective 03 - Being able to use "group by" to accumulate tiles to form a new raster.''' ==
     66 
     67
     68'''ST_Union(raster|geometry, raster|geometry, ‘raster’|’geometry’) -> raster/geometry'''[[BR]]
     69'''ST_Accum(raster set|geometry set, ‘raster’|’geometry’) -> raster/geometry'''
     70
     71
     72----
     73== '''Objective 05 - Being able to reproject a raster.''' ==
    4174 
    4275
     
    4477 
    4578----
    46 == '''Objective B03d - Being able to do some base raster operations.''' ==
     79== '''Objective 06 - Being able to do some base raster operations.''' ==
    4780 
    4881
     
    101134
    102135----
    103 == '''Objective B03e - Being able to quickly get raster statistics.''' ==
    104 
    105 '''Add cached basic raster statistic to the base raster WKB format.
    106 
    107 ----
    108 == '''Objective B03f - Being able to refer to band by textual name.''' ==
    109 
    110 '''Add 8 digit string to each band in the base raster WKB format.
    111 
    112 '''Adjust gdal2wktraster.py to be able to give names to each band when importing.
    113 
    114 '''Adjust/overlaod every function to be able to refer to raster band by name.
    115 
    116 
    117 ----
    118 == '''PostGIS WKT Raster Beta 0.4''' ==
    119  
    120 ----
    121 == '''Objective B04a - Being able to convert a raster to standards formats.''' ==
     136== '''Objective 07 - Being able to convert a raster to standards formats.''' ==
    122137 
    123138
     
    126141 
    127142----
    128 == '''Objective B04b - Being able to control the validity of a raster.''' ==
     143== '''Objective 08 - Being able to control the validity of a raster.''' ==
    129144 
    130145
     
    134149 
    135150----
    136 == '''Objective B04c - Being able to use other major topological operators''' ==
     151== '''Objective 09 - Being able to use other major topological operators''' ==
    137152 
    138153
     
    142157
    143158----
    144 == '''PostGIS WKT Raster Beta 0.5''' ==
    145  
    146 ----
    147 == '''Objective B05a - Being able to derive a raster layer from vector layer.''' ==
     159== '''Objective 10 - Being able to derive a raster layer from vector layer.''' ==
    148160 
    149161
     
    151163 
    152164----
    153 == '''Objective B05b - Being able to do on rasters most operations available on geometries''' ==
     165== '''Objective 11 - Being able to do on rasters most operations available on geometries''' ==
    154166 
    155167
     
    157169'''ST_PointOnSurface(raster|geometry) -> point geometry'''[[BR]]
    158170'''ST_Buffer(raster|geometry, double) -> same type as first arg.'''[[BR]]
    159 '''ST_ConvexHull(raster|geometry) -> same type as input'''[[BR]]
    160171'''ST_Difference(raster|geometry A, raster|geometry B) -> same type as first argument'''[[BR]]
    161172'''ST_SymDifference(raster|geometry,raster|geometry,‘raster’|’geometry’) -> raster/geometry'''
    162 
    163 
    164 ----
    165 == '''PostGIS WKT Raster Beta 0.6''' ==
    166  
    167 ----
    168 == '''Objective B06a - Being able to use all the other topological operators''' ==
     173 
     174----
     175== '''Objective 12 - Being able to use all the other topological operators''' ==
    169176 
    170177
     
    178185 
    179186----
    180 == '''Objective B07b - Being able to edit a raster''' ==
    181  
    182 
    183 '''ST_Value(raster, band, x, y) -> value'''[[BR]]
    184 Return value of a single pixel. Pixel location is specified by 1-based index of Nth band of raster and X,Y coordinates.[[BR]]
    185 The X coordinate is expected to be in range of [1, ST_Width(raster)] and Y coordinate in range of [1, ST_Height(raster))].
    186 Return value is of type of 64-bit float-point number.[[BR]]
    187 '''TODO''': mloskot: Should we return NUMERIC instead of FLOAT8?
    188 
    189 
    190 '''ST_SetValue(raster, band, x, y, value)'''[[BR]]
     187== '''Objective 13 - Being able to edit a raster''' ==
     188 
    191189'''ST_Affine(raster|geometry,…) -> same type as input'''[[BR]]
    192190'''ST_Translate(raster|geometry,…) -> same type as input'''[[BR]]
     
    195193'''ST_RotateZ,Y,Z(raster|geometry, float8) -> same type as input'''
    196194
    197 '''Other functions'''
     195----
     196== '''Objective 14 - Being able to intersect two rasters to get a raster.''' ==
     197 
     198'''ST_Intersection(raster, integer, raster, integer) -> raster''' - Returns a two bands raster with values only in the intersecting areas of both rasters. Integer parameters are the band number of the raster.
     199
     200 '''Variants'''
     201
     202  1) ST_Intersection(raster, integer, raster, integer) -> raster -- the integer parameters are the band number of the rasters[[BR]]
     203  2) ST_Intersection(raster, raster, integer) -> raster -- default first raster to band # 1[[BR]]
     204  3) ST_Intersection(raster, integer, raster) -> raster -- default second raster to band # 1[[BR]]
     205  4) ST_Intersection(raster, raster) -> raster -- default both rasters to band # 1
     206
     207----
     208== '''Objective 15 - Being able to intersect two rasters to get a geometry.''' ==
     209 
     210'''ST_Intersection(raster, integer, raster, integer, 'geometry') -> geometry''' - Returns a two bands raster with values only in the intersecting areas of both rasters. Integer parameters are the band number of the raster.
     211
     212
     213 '''Variants'''
     214
     215  1) ST_Intersection(raster, integer, raster, integer, 'geometry') -> geometry[[BR]]
     216  2) ST_Intersection(raster, raster, integer, 'geometry') -> geometry -- default first raster to band # 1[[BR]]
     217  3) ST_Intersection(raster, integer, raster, 'geometry') -> geometry -- default second raster to band # 1[[BR]]
     218  4) ST_Intersection(raster, raster, 'geometry') -> geometry -- default both raster to band # 1
     219
     220----
     221== '''Objective 16 - Being able to quickly get raster statistics.''' ==
     222
     223'''Add cached basic raster statistic to the base raster WKB format.
     224
     225----
     226== '''Objective 17 - Being able to refer to band by textual name.''' ==
     227
     228'''Add 8 digit string to each band in the base raster WKB format.
     229
     230'''Adjust gdal2wktraster.py to be able to give names to each band when importing.
     231
     232'''Adjust/overlaod every function to be able to refer to raster band by name.
     233 
     234----
     235== '''Objective 18 - Being able to load rasters from SQL''' ==
     236
     237The idea is to change the rt_band_get_data core function so it load filesystem registered raster data using GDAL into the data base. This allow us to create a list of raster with a new ST_MakeRegisteredRaster("c:/temp/mytiff/*.tif") and to convert them witinot a CREATE TABLE with a ST_MakeBandInDB(rast, band)
     238
     239'''Changes to the rt_band_get_data core function'''[[BR]]
     240'''ST_MakeRegisteredRaster(wildcardPath)'''[[BR]]
     241'''ST_SetPath(raster, band, string)'''[[BR]]
     242'''ST_MakeBandInDB(rast, band)'''
     243
     244----
     245== '''Other functions''' ==
    198246 
    199247
     
    203251'''ST_AsText(raster)'''
    204252
    205 ----
    206 == '''Objective B07c - Being able to load rasters from SQL''' ==
    207 
    208 The idea is to change the rt_band_get_data core function so it load filesystem registered raster data using GDAL into the data base. This allow us to create a list of raster with a new ST_MakeRegisteredRaster("c:/temp/mytiff/*.tif") and to convert them witinot a CREATE TABLE with a ST_MakeBandInDB(rast, band)
    209 
    210 '''Changes to the rt_band_get_data core function'''[[BR]]
    211 '''ST_MakeRegisteredRaster(wildcardPath)'''[[BR]]
    212 '''ST_SetPath(raster, band, string)'''[[BR]]
    213 '''ST_MakeBandInDB(rast, band)'''
    214 
    215 
     253