Changes between Version 89 and Version 90 of WKTRaster/SpecificationWorking03


Ignore:
Timestamp:
May 26, 2011, 12:11:37 PM (13 years ago)
Author:
Bborie Park
Comment:

ST_ValueCount

Legend:

Unmodified
Added
Removed
Modified
  • WKTRaster/SpecificationWorking03

    v89 v90  
    870870
    871871'''ST_Area(raster|geometry) -> double'''[[BR]]
    872 '''ST_Count(raster, value) -> integer'''[[BR]]
     872
     873----
     874
     875'''ST_ValueCount(raster, value) -> integer'''[[BR]]
     876
     877ST_ValueCount provides the ability to count the number of times that a user-provided value is present in a raster. To handle floating point values, a rounding argument is provided.
     878
     879A set of functions for one or more search values:
     880
     881''If NULL is passed for "searchvalues" to any of the ST_ValueCount variations with "searchvalues", the function returns the counts for all unique values''
     882
     8831. ST_ValueCount(rast raster, nband integer, hasnodata boolean, searchvalues double precision[], roundto double precision) -> setof record (searchvalue, count)
     884
     885    returns the number of times that each value in searchvalues is present in the raster
     886
     887    hasnodata: if FALSE, nodata values in band are considered in the count. if TRUE, nodata values are not considered
     888
     889    searchvalues: the set of values to count in the raster
     890
     891    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.
     892
     893        examples are...
     894
     895{{{
     896        roundto < 0: no rounding
     897
     898        0: no rounding
     899
     900        0.1: round to the tenths place
     901
     902        0.01: round to the hundredths place
     903
     904        0.001: round to the thousandths place
     905
     906        1: round to the ones place
     907
     908        10: round to the tens place
     909
     910        100: round to the hundreds place
     911}}}
     912
     913{{{
     914ST_ValueCount(rast, 1, TRUE, ARRAY[23], 0)
     915
     916ST_ValueCount(rast, 5, FALSE, ARRAY[3.14], 0.01)
     917
     918ST_ValueCount(rast, 2, TRUE, ARRAY[100], 100)
     919
     920ST_ValueCount(rast, 1, FALSE, ARRAY[-9999, 0], 1)
     921
     922ST_ValueCount(rast, 1, FALSE, NULL::double precision[], 1)
     923}}}
     924
     9252. ST_ValueCount(rast raster, nband integer, searchvalues double precision[], roundto double precision) -> setof record (searchvalue, count)
     926
     927    hasnodata is assumed to be TRUE
     928
     929{{{
     930ST_ValueCount(rast, 5, ARRAY[3.14], 0.01)
     931
     932ST_ValueCount(rast, 2, NULL::double precision[], 100)
     933}}}
     934
     9353. ST_ValueCount(rast raster, nband integer, searchvalues double precision[]) -> setof record (searchvalue, count)
     936
     937    roundto is assumed to be 0, so no rounding takes place. hasnodata is assumed to be TRUE
     938
     939{{{
     940ST_ValueCount(rast, 1, ARRAY[-9999])
     941
     942ST_ValueCount(rast, 1, NULL::double precision[])
     943}}}
     944
     9454. ST_ValueCount(rast raster, searchvalues double precision[], roundto double precision) -> setof record (searchvalue, count)
     946
     947    nband is assumed to be 1. hasnodata is assumed to be TRUE.
     948
     9495. ST_ValueCount(rast raster, searchvalues double precision[]) -> setof record (searchvalue, count)
     950
     951    nband is assumed to be 1. roundto is assumed to be 0, so no rounding takes place. hasnodata is assumed to be TRUE.
     952
     953A set of functions for a single search value:
     954
     9551. ST_ValueCount(rast raster, nband integer, hasnodata boolean, searchvalue double precision, roundto double precision) -> integer
     956
     957    returns the number of times that searchvalue is present in the raster
     958
     959    searchvalue: the value to count in the raster
     960
     961{{{
     962ST_ValueCount(rast, 1, TRUE, 23, 0)
     963
     964ST_ValueCount(rast, 5, FALSE, 3.14, 0.01)
     965
     966ST_ValueCount(rast, 2, TRUE, 100, 100)
     967
     968ST_ValueCount(rast, 1, FALSE, -9999, 1)
     969}}}
     970
     9712. ST_ValueCount(rast raster, nband integer, searchvalue double precision, roundto double precision) -> integer
     972
     973    hasnodata is assumed to be TRUE
     974
     975{{{
     976ST_ValueCount(rast, 5, 3.14, 0.01)
     977
     978ST_ValueCount(rast, 2, 100, 100)
     979}}}
     980
     9813. ST_ValueCount(rast raster, nband integer, searchvalue double precision) -> integer
     982
     983    roundto is assumed to be 0, so no rounding takes place. hasnodata is assumed to be TRUE
     984
     985{{{
     986ST_ValueCount(rast, 1, -9999)
     987}}}
     988
     9894. ST_ValueCount(rast raster, searchvalue double precision, roundto double precision) -> integer
     990
     991    nband is assumed to be 1. hasnodata is assumed to be TRUE.
     992
     9935. ST_ValueCount(rast raster, searchvalue double precision) -> integer
     994
     995    nband is assumed to be 1. roundto is assumed to be 0, so no rounding takes place. hasnodata is assumed to be TRUE.
     996
     997The set of functions for processing coverages return "bigint" instead of "integer".
     998
     999A set of functions for one or more search values:
     1000
     10011. ST_ValueCount(rastertable text, rastercolumn text, nband integer, hasnodata boolean, searchvalues double precision[], roundto double precision) -> setof record (searchvalue, count)
     1002
     1003    rastertable: name of the table with a raster column
     1004
     1005    rastercolumn: name of the raster column
     1006
     1007{{{
     1008ST_ValueCount('test', 'rast', 1, TRUE, ARRAY[23], 0)
     1009
     1010ST_ValueCount('test', 'rast', 5, FALSE, ARRAY[3.14], 0.01)
     1011
     1012ST_ValueCount('test', 'rast', 2, TRUE, ARRAY[100], 100)
     1013
     1014ST_ValueCount('test', 'rast', 1, FALSE, ARRAY[-9999, 0], 1)
     1015
     1016ST_ValueCount('test', 'rast', 1, FALSE, NULL::double precision[], 1)
     1017}}}
     1018
     10192. ST_ValueCount(rastertable text, rastercolumn text, nband integer, searchvalues double precision[], roundto double precision) -> setof record (searchvalue, count)
     1020
     1021    hasnodata is assumed to be TRUE
     1022
     1023{{{
     1024ST_ValueCount('test', 'rast', 5, ARRAY[3.14], 0.01)
     1025
     1026ST_ValueCount('test', 'rast', 2, NULL::double precision[], 100)
     1027}}}
     1028
     10293. ST_ValueCount(rastertable text, rastercolumn text, nband integer, searchvalues double precision[]) -> setof record (searchvalue, count)
     1030
     1031    roundto is assumed to be 0, so no rounding takes place. hasnodata is assumed to be TRUE
     1032
     1033{{{
     1034ST_ValueCount('test', 'rast', 1, ARRAY[-9999])
     1035
     1036ST_ValueCount('test', 'rast', 1, NULL::double precision[])
     1037}}}
     1038
     10394. ST_ValueCount(rastertable text, rastercolumn text, searchvalues double precision[], roundto double precision) -> setof record (searchvalue, count)
     1040
     1041    nband is assumed to be 1. hasnodata is assumed to be TRUE.
     1042
     10435. ST_ValueCount(rastertable text, rastercolumn text, searchvalues double precision[]) -> setof record (searchvalue, count)
     1044
     1045    nband is assumed to be 1. roundto is assumed to be 0, so no rounding takes place. hasnodata is assumed to be TRUE.
     1046
     1047A set of functions for a single search value:
     1048
     10491. ST_ValueCount(rastertable text, rastercolumn text, nband integer, hasnodata boolean, searchvalue double precision, roundto double precision) -> bigint
     1050
     1051    returns the number of times that searchvalue is present in the raster
     1052
     1053    searchvalue: the value to count in the raster
     1054
     1055{{{
     1056ST_ValueCount('test', 'rast', 1, TRUE, 23, 0)
     1057
     1058ST_ValueCount('test', 'rast', 5, FALSE, 3.14, 0.01)
     1059
     1060ST_ValueCount('test', 'rast', 2, TRUE, 100, 100)
     1061
     1062ST_ValueCount('test', 'rast', 1, FALSE, -9999, 1)
     1063}}}
     1064
     10652. ST_ValueCount(rastertable text, rastercolumn text, nband integer, searchvalue double precision, roundto double precision) -> bigint
     1066
     1067    hasnodata is assumed to be TRUE
     1068
     1069{{{
     1070ST_ValueCount('test', 'rast', 5, 3.14, 0.01)
     1071
     1072ST_ValueCount('test', 'rast', 2, 100, 100)
     1073}}}
     1074
     10753. ST_ValueCount(rastertable text, rastercolumn text, nband integer, searchvalue double precision) -> bigint
     1076
     1077    roundto is assumed to be 0, so no rounding takes place. hasnodata is assumed to be TRUE
     1078
     1079{{{
     1080ST_ValueCount('test', 'rast', 1, -9999)
     1081}}}
     1082
     10834. ST_ValueCount(rastertable text, rastercolumn text, searchvalue double precision, roundto double precision) -> bigint
     1084
     1085    nband is assumed to be 1. hasnodata is assumed to be TRUE.
     1086
     10875. ST_ValueCount(rastertable text, rastercolumn text, searchvalue double precision) -> bigint
     1088
     1089    nband is assumed to be 1. roundto is assumed to be 0, so no rounding takes place. hasnodata is assumed to be TRUE.
     1090
     1091----
    8731092
    8741093'''ST_Resample(raster, method, originx, originy, pixelsizex, pixelsizey) -> raster'''