Changes between Version 90 and Version 91 of WKTRaster/SpecificationWorking03


Ignore:
Timestamp:
05/26/11 12:49:38 (14 years ago)
Author:
dustymugs
Comment:

ST_ValuePercent

Legend:

Unmodified
Added
Removed
Modified
  • WKTRaster/SpecificationWorking03

    v90 v91  
    104910491. ST_ValueCount(rastertable text, rastercolumn text, nband integer, hasnodata boolean, searchvalue double precision, roundto double precision) -> bigint
    10501050
    1051     returns the number of times that searchvalue is present in the raster
    1052 
    10531051    searchvalue: the value to count in the raster
    10541052
     
    10861084
    108710855. ST_ValueCount(rastertable text, rastercolumn text, searchvalue double precision) -> bigint
     1086
     1087    nband is assumed to be 1. roundto is assumed to be 0, so no rounding takes place. hasnodata is assumed to be TRUE.
     1088
     1089----
     1090
     1091'''ST_ValuePercent(raster, value) -> double precision'''[[BR]]
     1092
     1093ST_ValuePercent is the sibling of ST_ValueCount and returns the percentage of a raster's band that is of a specified value. To handle floating point values, a rounding argument is provided.
     1094
     1095A set of functions for one or more search values:
     1096
     1097''If NULL is passed for "searchvalues" to any of the ST_ValuePercent variations with "searchvalues", the function returns the percents for all unique values''
     1098
     10991. ST_ValuePercent(rast raster, nband integer, hasnodata boolean, searchvalues double precision[], roundto double precision) -> setof record (searchvalue, percent)
     1100
     1101    returns the percentage of a raster's band that each value in searchvalues is found
     1102
     1103    hasnodata: if FALSE, nodata values in band are considered in the percents. if TRUE, nodata values are not considered
     1104
     1105    searchvalues: the set of values to get percents for in the raster
     1106
     1107    roundto: the decimal position to round a pixel value to. Originally intended for use with 32BF and 64BF pixel types, it can also be used with integers when round to the tens, hundreds or higher place.
     1108
     1109        examples are...
     1110
     1111{{{
     1112        roundto < 0: no rounding
     1113
     1114        0: no rounding
     1115
     1116        0.1: round to the tenths place
     1117
     1118        0.01: round to the hundredths place
     1119
     1120        0.001: round to the thousandths place
     1121
     1122        1: round to the ones place
     1123
     1124        10: round to the tens place
     1125
     1126        100: round to the hundreds place
     1127}}}
     1128
     1129{{{
     1130ST_ValuePercent(rast, 1, TRUE, ARRAY[23], 0)
     1131
     1132ST_ValuePercent(rast, 5, FALSE, ARRAY[3.14], 0.01)
     1133
     1134ST_ValuePercent(rast, 2, TRUE, ARRAY[100], 100)
     1135
     1136ST_ValuePercent(rast, 1, FALSE, ARRAY[-9999, 0], 1)
     1137
     1138ST_ValuePercent(rast, 1, FALSE, NULL::double precision[], 1)
     1139}}}
     1140
     11412. ST_ValuePercent(rast raster, nband integer, searchvalues double precision[], roundto double precision) -> setof record (searchvalue, percent)
     1142
     1143    hasnodata is assumed to be TRUE
     1144
     1145{{{
     1146ST_ValuePercent(rast, 5, ARRAY[3.14], 0.01)
     1147
     1148ST_ValuePercent(rast, 2, NULL::double precision[], 100)
     1149}}}
     1150
     11513. ST_ValuePercent(rast raster, nband integer, searchvalues double precision[]) -> setof record (searchvalue, percent)
     1152
     1153    roundto is assumed to be 0, so no rounding takes place. hasnodata is assumed to be TRUE
     1154
     1155{{{
     1156ST_ValuePercent(rast, 1, ARRAY[-9999])
     1157
     1158ST_ValuePercent(rast, 1, NULL::double precision[])
     1159}}}
     1160
     11614. ST_ValuePercent(rast raster, searchvalues double precision[], roundto double precision) -> setof record (searchvalue, percent)
     1162
     1163    nband is assumed to be 1. hasnodata is assumed to be TRUE.
     1164
     11655. ST_ValuePercent(rast raster, searchvalues double precision[]) -> setof record (searchvalue, percent)
     1166
     1167    nband is assumed to be 1. roundto is assumed to be 0, so no rounding takes place. hasnodata is assumed to be TRUE.
     1168
     1169A set of functions for a single search value:
     1170
     11711. ST_ValuePercent(rast raster, nband integer, hasnodata boolean, searchvalue double precision, roundto double precision) -> integer
     1172
     1173    searchvalue: the value to get a percent for in the raster
     1174
     1175{{{
     1176ST_ValuePercent(rast, 1, TRUE, 23, 0)
     1177
     1178ST_ValuePercent(rast, 5, FALSE, 3.14, 0.01)
     1179
     1180ST_ValuePercent(rast, 2, TRUE, 100, 100)
     1181
     1182ST_ValuePercent(rast, 1, FALSE, -9999, 1)
     1183}}}
     1184
     11852. ST_ValuePercent(rast raster, nband integer, searchvalue double precision, roundto double precision) -> integer
     1186
     1187    hasnodata is assumed to be TRUE
     1188
     1189{{{
     1190ST_ValuePercent(rast, 5, 3.14, 0.01)
     1191
     1192ST_ValuePercent(rast, 2, 100, 100)
     1193}}}
     1194
     11953. ST_ValuePercent(rast raster, nband integer, searchvalue double precision) -> integer
     1196
     1197    roundto is assumed to be 0, so no rounding takes place. hasnodata is assumed to be TRUE
     1198
     1199{{{
     1200ST_ValuePercent(rast, 1, -9999)
     1201}}}
     1202
     12034. ST_ValuePercent(rast raster, searchvalue double precision, roundto double precision) -> integer
     1204
     1205    nband is assumed to be 1. hasnodata is assumed to be TRUE.
     1206
     12075. ST_ValuePercent(rast raster, searchvalue double precision) -> integer
     1208
     1209    nband is assumed to be 1. roundto is assumed to be 0, so no rounding takes place. hasnodata is assumed to be TRUE.
     1210
     1211The set of functions for processing coverages return "bigint" instead of "integer".
     1212
     1213A set of functions for one or more search values:
     1214
     12151. ST_ValuePercent(rastertable text, rastercolumn text, nband integer, hasnodata boolean, searchvalues double precision[], roundto double precision) -> setof record (searchvalue, percent)
     1216
     1217    rastertable: name of the table with a raster column
     1218
     1219    rastercolumn: name of the raster column
     1220
     1221{{{
     1222ST_ValuePercent('test', 'rast', 1, TRUE, ARRAY[23], 0)
     1223
     1224ST_ValuePercent('test', 'rast', 5, FALSE, ARRAY[3.14], 0.01)
     1225
     1226ST_ValuePercent('test', 'rast', 2, TRUE, ARRAY[100], 100)
     1227
     1228ST_ValuePercent('test', 'rast', 1, FALSE, ARRAY[-9999, 0], 1)
     1229
     1230ST_ValuePercent('test', 'rast', 1, FALSE, NULL::double precision[], 1)
     1231}}}
     1232
     12332. ST_ValuePercent(rastertable text, rastercolumn text, nband integer, searchvalues double precision[], roundto double precision) -> setof record (searchvalue, percent)
     1234
     1235    hasnodata is assumed to be TRUE
     1236
     1237{{{
     1238ST_ValuePercent('test', 'rast', 5, ARRAY[3.14], 0.01)
     1239
     1240ST_ValuePercent('test', 'rast', 2, NULL::double precision[], 100)
     1241}}}
     1242
     12433. ST_ValuePercent(rastertable text, rastercolumn text, nband integer, searchvalues double precision[]) -> setof record (searchvalue, percent)
     1244
     1245    roundto is assumed to be 0, so no rounding takes place. hasnodata is assumed to be TRUE
     1246
     1247{{{
     1248ST_ValuePercent('test', 'rast', 1, ARRAY[-9999])
     1249
     1250ST_ValuePercent('test', 'rast', 1, NULL::double precision[])
     1251}}}
     1252
     12534. ST_ValuePercent(rastertable text, rastercolumn text, searchvalues double precision[], roundto double precision) -> setof record (searchvalue, percent)
     1254
     1255    nband is assumed to be 1. hasnodata is assumed to be TRUE.
     1256
     12575. ST_ValuePercent(rastertable text, rastercolumn text, searchvalues double precision[]) -> setof record (searchvalue, percent)
     1258
     1259    nband is assumed to be 1. roundto is assumed to be 0, so no rounding takes place. hasnodata is assumed to be TRUE.
     1260
     1261A set of functions for a single search value:
     1262
     12631. ST_ValuePercent(rastertable text, rastercolumn text, nband integer, hasnodata boolean, searchvalue double precision, roundto double precision) -> bigint
     1264
     1265    searchvalue: the value to get a percent for in the raster
     1266
     1267{{{
     1268ST_ValuePercent('test', 'rast', 1, TRUE, 23, 0)
     1269
     1270ST_ValuePercent('test', 'rast', 5, FALSE, 3.14, 0.01)
     1271
     1272ST_ValuePercent('test', 'rast', 2, TRUE, 100, 100)
     1273
     1274ST_ValuePercent('test', 'rast', 1, FALSE, -9999, 1)
     1275}}}
     1276
     12772. ST_ValuePercent(rastertable text, rastercolumn text, nband integer, searchvalue double precision, roundto double precision) -> bigint
     1278
     1279    hasnodata is assumed to be TRUE
     1280
     1281{{{
     1282ST_ValuePercent('test', 'rast', 5, 3.14, 0.01)
     1283
     1284ST_ValuePercent('test', 'rast', 2, 100, 100)
     1285}}}
     1286
     12873. ST_ValuePercent(rastertable text, rastercolumn text, nband integer, searchvalue double precision) -> bigint
     1288
     1289    roundto is assumed to be 0, so no rounding takes place. hasnodata is assumed to be TRUE
     1290
     1291{{{
     1292ST_ValuePercent('test', 'rast', 1, -9999)
     1293}}}
     1294
     12954. ST_ValuePercent(rastertable text, rastercolumn text, searchvalue double precision, roundto double precision) -> bigint
     1296
     1297    nband is assumed to be 1. hasnodata is assumed to be TRUE.
     1298
     12995. ST_ValuePercent(rastertable text, rastercolumn text, searchvalue double precision) -> bigint
    10881300
    10891301    nband is assumed to be 1. roundto is assumed to be 0, so no rounding takes place. hasnodata is assumed to be TRUE.