1209 | | The mean returned in the coverage functions (has rastertable and rastercolumn arguments) is a weighted mean of the means of each raster tile. The standard deviation returned is the cumulative standard deviation of all raster tiles. |
| 1209 | The mean returned in the coverage functions (has rastertable and rastercolumn arguments) is the true mean of the raster tiles. The standard deviation returned is the cumulative standard deviation of all raster tiles. |
| 1210 | |
| 1211 | ---- |
| 1212 | |
| 1213 | '''ST_Count(raster, nband) -> bigint'''[[BR]] |
| 1214 | |
| 1215 | This function calls ST_SummaryStats and only returns the count from that function. |
| 1216 | |
| 1217 | 1. ST_Count(rast raster, nband int, hasnodata boolean) -> bigint |
| 1218 | |
| 1219 | returns the count as an integer |
| 1220 | |
| 1221 | nband: index of band |
| 1222 | |
| 1223 | hasnodata: if FALSE, any pixel who's value is nodata is ignored |
| 1224 | |
| 1225 | {{{ |
| 1226 | ST_Count(rast, 1, FALSE) |
| 1227 | }}} |
| 1228 | |
| 1229 | 2. ST_Count(rast raster, nband int) -> bigint |
| 1230 | |
| 1231 | assumes hasnodata = TRUE |
| 1232 | |
| 1233 | {{{ |
| 1234 | ST_Count(rast, 2) |
| 1235 | }}} |
| 1236 | |
| 1237 | 3. ST_Count(rast raster, hasnodata boolean) -> bigint |
| 1238 | |
| 1239 | assumes nband = 1 |
| 1240 | |
| 1241 | {{{ |
| 1242 | ST_Count(rast, TRUE) |
| 1243 | }}} |
| 1244 | |
| 1245 | 4. ST_Count(rast raster) -> bigint |
| 1246 | |
| 1247 | assumes nband = 1 and hasnodata = TRUE |
| 1248 | |
| 1249 | {{{ |
| 1250 | ST_Count(rast) |
| 1251 | }}} |
| 1252 | |
| 1253 | The set of ST_ApproxCount functions are: |
| 1254 | |
| 1255 | 1. ST_ApproxCount(rast raster, nband int, hasnodata boolean, sample_percent double precision) -> bigint |
| 1256 | |
| 1257 | sample_percent: a value between 0 and 1 indicating the percentage of the raster band's pixels to consider |
| 1258 | |
| 1259 | {{{ |
| 1260 | ST_ApproxCount(rast, 3, FALSE, 0.1) |
| 1261 | |
| 1262 | ST_ApproxCount(rast, 1, TRUE, 0.5) |
| 1263 | }}} |
| 1264 | |
| 1265 | 2. ST_ApproxCount(rast raster, nband int, sample_percent double precision) -> bigint |
| 1266 | |
| 1267 | assumes that nband = 1 |
| 1268 | |
| 1269 | {{{ |
| 1270 | ST_ApproxCount(rast, 2 0.01) |
| 1271 | |
| 1272 | ST_ApproxCount(rast, 4, 0.025) |
| 1273 | }}} |
| 1274 | |
| 1275 | 3. ST_ApproxCount(rast raster, hasnodata boolean, sample_percent double precision) -> bigint |
| 1276 | |
| 1277 | assumes that nband = 1 |
| 1278 | |
| 1279 | {{{ |
| 1280 | ST_ApproxCount(rast, FALSE, 0.01) |
| 1281 | |
| 1282 | ST_ApproxCount(rast, TRUE, 0.025) |
| 1283 | }}} |
| 1284 | |
| 1285 | 4. ST_ApproxCount(rast raster, sample_percent double precision) -> bigint |
| 1286 | |
| 1287 | assumes that nband = 1 and hasnodata = TRUE |
| 1288 | |
| 1289 | {{{ |
| 1290 | ST_ApproxCount(rast, 0.25) |
| 1291 | }}} |
| 1292 | |
| 1293 | 5. ST_ApproxCount(rast raster) -> bigint |
| 1294 | |
| 1295 | assumes that nband = 1, hasnodata = TRUE and sample_percent = 0.1 |
| 1296 | |
| 1297 | {{{ |
| 1298 | ST_ApproxCount(rast) |
| 1299 | }}} |
| 1300 | |
| 1301 | The following functions are provided for coverage tables. |
| 1302 | |
| 1303 | 1. ST_Count(rastertable text, rastercolumn text, nband int, hasnodata boolean) -> bigint |
| 1304 | |
| 1305 | rastertable: name of table with raster column |
| 1306 | |
| 1307 | rastercolumn: name of column of data type raster |
| 1308 | |
| 1309 | {{{ |
| 1310 | ST_Count('tmax_2010', 'rast', 1, FALSE) |
| 1311 | |
| 1312 | ST_Count('precip_2011', 'rast', 1, TRUE) |
| 1313 | }}} |
| 1314 | |
| 1315 | 2. ST_Count(rastertable text, rastercolumn text, nband int) -> bigint |
| 1316 | |
| 1317 | hasnodata = TRUE |
| 1318 | |
| 1319 | {{{ |
| 1320 | ST_Count('tmax_2010', 'rast', 1) |
| 1321 | }}} |
| 1322 | |
| 1323 | 3. ST_Count(rastertable text, rastercolumn text, hasnodata boolean) -> bigint |
| 1324 | |
| 1325 | nband = 1 |
| 1326 | |
| 1327 | {{{ |
| 1328 | ST_Count('precip_2011', 'rast', TRUE) |
| 1329 | }}} |
| 1330 | |
| 1331 | 4. ST_Count(rastertable text, rastercolumn text) -> bigint |
| 1332 | |
| 1333 | nband = 1 and hasnodata = TRUE |
| 1334 | |
| 1335 | {{{ |
| 1336 | ST_Count('tmin_2009', 'rast') |
| 1337 | }}} |
| 1338 | |
| 1339 | Variations for ST_ApproxCount are: |
| 1340 | |
| 1341 | 1. ST_ApproxCount(rastertable text, rastercolumn text, nband int, hasnodata boolean, sample_percent double precision) -> bigint |
| 1342 | |
| 1343 | {{{ |
| 1344 | ST_ApproxCount('tmax_2010', 'rast', 1, FALSE, 0.5) |
| 1345 | |
| 1346 | ST_ApproxCount('precip_2011', 'rast', 1, TRUE, 0.2) |
| 1347 | }}} |
| 1348 | |
| 1349 | 2. ST_ApproxCount(rastertable text, rastercolumn text, nband int, sample_percent double precision) -> bigint |
| 1350 | |
| 1351 | hasnodata = TRUE |
| 1352 | |
| 1353 | {{{ |
| 1354 | ST_ApproxCount('tmax_2010', 'rast', 1, 0.5) |
| 1355 | |
| 1356 | ST_ApproxCount('precip_2011', 'rast', 1, 0.2) |
| 1357 | }}} |
| 1358 | |
| 1359 | 3. ST_ApproxCount(rastertable text, rastercolumn text, hasnodata boolean, sample_percent double precision) -> bigint |
| 1360 | |
| 1361 | nband = 1 |
| 1362 | |
| 1363 | {{{ |
| 1364 | ST_ApproxCount('tmax_2010', 'rast', FALSE, 0.5) |
| 1365 | |
| 1366 | ST_ApproxCount('precip_2011', 'rast', TRUE, 0.2) |
| 1367 | }}} |
| 1368 | |
| 1369 | 4. ST_ApproxCount(rastertable text, rastercolumn text, sample_percent double precision) -> bigint |
| 1370 | |
| 1371 | nband = 1 and hasnodata = TRUE |
| 1372 | |
| 1373 | {{{ |
| 1374 | ST_ApproxCount('tmax_2010', 'rast', 0.5) |
| 1375 | |
| 1376 | ST_ApproxCount('precip_2011', 'rast', 0.2) |
| 1377 | }}} |
| 1378 | |
| 1379 | 5. ST_ApproxCount(rastertable text, rastercolumn text) -> bigint |
| 1380 | |
| 1381 | nband = 1, hasnodata = TRUE and sample_percent = 0.1 |
| 1382 | |
| 1383 | {{{ |
| 1384 | ST_ApproxCount('tmax_2010', 'rast') |
| 1385 | |
| 1386 | ST_ApproxCount('precip_2011', 'rast') |
| 1387 | }}} |