MI_GridRegionStats

Description

Returns the aggregated statistics from a raster within a region object. This function also applies to an MRR file and continuous field types with numeric bands.

Syntax

MI_GridRegionStats (GridInfo, multipolygon, <field>, <band>)

Note: field and band are only applicable for MRR and are optional parameters. See Arguments for more details.

Arguments

MI_GridRegionStats has the following arguments:
  • GridInfo identifies the information from the Raster or Grid file. The value is always the string MI_RASTER.

  • multipolygon is an expression which returns a multipolygon geometry.

  • field specifies the field index and is an integer value greater than or equal to zero (0). It is an optional parameter.

  • band specifies the band index of the field selected and is an integer value greater than or equal to zero (0). It is required only if the field is specified.

Example

Determines the grid value of the MI_RASTER column at the specified point geometry from the table named GRIDTABLE.

SELECT  MI_GridRegionStats("MI_RASTER",FromWKT('POLYGON ((8211602.1116507 4485899.72505268,8124399.35624303 4481233.2298097,7964837.11063283 4406853.5580153,7961125.24236236 4572597.8358136,7933294.50582478 4577304.76674842,7914740.41429961 4636325.1674227,7853512.80193194 4615038.60095963,7820116.28677699 4530328.75203906,7723637.36725711 4488230.24757304,7693951.23759702 4462586.0840956,7616025.60810197 4460257.44510103,7556653.58923189 4448623.9482822,7525112.06644928 4474233.58713276,7573532.70535966 4564193.36342674,7621953.46449509 4654939.11098547,7605326.90112247 4710530.21233189,7538545.89331758 4759032.80465187,7502161.34484354 4818043.80773473,7648263.9552747 4927323.94994811,7794366.76608094 5037831.62999759,7901287.79224849 5116324.62154215,8053833.78408741 5104560.15956879,8149643.69127874 5017909.15698999,7995843.23119251 4967838.64967968,7842042.89133133 4918023.15973804,7824928.77530572 4824108.5603849,8012698.34238529 4798111.21578541,8200467.94953989 4772180.85657631,8232010.31389784 4655285.63965475,8332200.98146314 4645802.5882688,8360032.75995116 4483567.33904405,8341478.58827596 4471908.25432707,8339623.43560355 4471908.25432707,8244999.18785588 4483566.63773126,8211602.1116507 4485899.72505268))', 'EPSG:3857'),0,0) FROM "/Samples/NamedTables/MRRWorldTable" 

Remarks

The band and field value precedence rules for MRR

  • When field and band values are in the query, the field and band values of the query are considered.
  • When query has no field and band values at all, values for all continuous fields and numeric bands values are returned as an array.