logo-header

 
 

syntax

  • raster_merge(target_domain, valuesunit, subgrid_1, ..., subgrid_n)
  • raster_merge(indexmap, valuesunit, subgrid_1, ..., subgrid_n)

definition

raster_merge(target_domain, valuesunit, subgrid_1, ..., subgrid_n) results in raster-data merged from the given subgrids. The values unit of the resulting raster data is given as second argument. The domain of the target grid is the domain unit configured as first argument. This variant can be used if the projection information can be derived from the domain units of the subgrids and the cell size of the target_domain equals the cell size of the subgrids. This raster_merge variant can be used both to merge data from smaller subgrids to a larger target grid or the other way around, from a large target grid towards a smaller subgrid.

raster_merge(indexmap, valuesunit, subgrid_1, ..., subgrid_n) results in raster-data merged from the given subgrids. The values unit of the resulting raster data is given as second argument , the results' domain is equal to the domain unit of the first argument, indexmap.This indexmap attribute contains index numbers, corresponing to the sequence numbers of the configured subgrids, whereas 0 referes to subgrid_1, 1 to subgrid_2, ..., n-1 to subgrid_n..

applies to

Attribute indexmap with uint16 value type

valuesunit must have a numeric value type with Numeric value type

Subgids must have values with the same type as valuesunit.

The point value type of the target_domain and the subgrids must match.

conditions

Indexmap and all subgrids must have 2 dimensional domains. The subgrids don't have to have the same domain as indexmap, but they must have compatible projections, At locations with indexmap values >= n or outside the domain of the indicated subgrid, the result will be <null>.

since version

raster_merge(target_domain, valuesunit, subgrid_1, ..., subgrid_n):  7.101

raster_merge(indexmap, valuesunit, subgrid_1, ..., subgrid_n): 7.013

example

attribute<uint16> indexmap (DomainM):=
switch(
  case(pointRow(id(DomainM)) <  2s && pointCol(id(DomainM)) <  2s, 0)
  ,case(pointRow(id(DomainM)) >= 2s && pointCol(id(DomainM)) <  2s, 1)
  ,case(pointRow(id(DomainM)) >= 2s && pointCol(id(DomainM)) >= 2s, 2)
  ,3
);
    
container SubGrids
{
unit<spoint> DomainA := range(DomainM, point(0s,0s), point(2s,2s));
   unit<spoint> DomainB := range(DomainM, point(2s,0s), point(5s,2s));
   unit<spoint> DomainC := range(DomainM, point(3s,2s), point(5s,5s));
   unit<spoint> DomainD := range(DomainM, point(0s,2s), point(3s,5s));
}
unit<uint8> codes;

attribute<codes> ToBeMergedI   (SubGrids/DomainA) :=
const(10, SubGrids/DomainA, codes);
attribute<codes> ToBeMergedII  (SubGrids/DomainB) :=
const(20, SubGrids/DomainB, codes);
attribute<codes> ToBeMergedIII (SubGrids/DomainC) :=
const(30, SubGrids/DomainC, codes);
attribute<codes> ToBeMergedIV  (SubGrids/DomainD) :=
const(40, SubGrids/DomainD, codes);

Example I:
attribute<codes> raster_merged (DomainM) :=
raster_merge(
   DomainM
      ,codes
      ,ToBeMergedI
      ,ToBeMergedII
      ,ToBeMergedIII
      ,ToBeMergedIV
   );

Example II:
attribute<codes> raster_merged (DomainM) :=
raster_merge(
   indexmap
   ,codes"
   ,ToBeMergedI
   ,ToBeMergedII
   ,ToBeMergedIII
   ,ToBeMergedIV
 );
indexmap
0 0 3 3 3
0 0 3 3 3
1 1 3 3 3
1 1 2 2 2
1 1 2 2 2
DomainM, nr of rows = 5, nr of cols = 5

ToBeMergedI
10 10
10 10
DomainA, nr of rows = 2, nr of cols = 2

ToBeMergedII
20 20
20 20
20 20
DomainB, nr of rows = 3, nr of cols = 2

ToBeMergedIII
30 30 30
30 30 30
DomainC, nr of rows = 2, nr of cols = 3

ToBeMergedIV
40 40 40
40 40 40
40 40 40
DomainD, nr of rows = 3, nr of cols = 3

raster_merged
10 10 40 40 40
10 10 40 40 40
20 20 40 40 40
20 20 30 30 30
20 20 30 30 30
DomainM, nr of rows = 5, nr of cols = 5

OBJECT VISION BV
Vrije Universiteit
De Boelelaan 1085
1081 HV Amsterdam
The Netherlands

tel: +31 (0)20 598 9083
fax:+31 (0)20 598 9904