Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
extract_map_attributes [2011/07/31 15:29]
hermann
extract_map_attributes [2026/08/28 03:18] (current)
hermann Sync from local documentation review
Line 1: Line 1:
-====== Extract Map Attributes =====+====== Extract Map Attributes ​======
  
 ===== Description ===== ===== Description =====
  
-This functor extracts the attributes and calculates ​basic statistics from a map and as a result creates a table that contains ​the extracted attributes.+Extracts general ​attributes and basic statistics from a map, returning them as a lookup ​table keyed by a predefined attribute code. All layers of the map are analyzed together, and the resulting table refers to them jointly.
  
 ===== Inputs ===== ===== Inputs =====
  
-^ Name ^ Type ^ Description ^ +^ Name  ^ Type  ^ Description ​ 
-| Map  | [[Map Type|Map]]  | Map whose attributes will be extracted. ​ |+| Map  | [[Map Type]] ​ | Map whose attributes will be extracted. ​ |
  
 ===== Optional Inputs ===== ===== Optional Inputs =====
  
-^ Name ^ Type ^ Description ^ Default Value ^ +^ Name  ^ Type  ^ Description ​ ^ Default Value  
-| Extract Dynamic Attributes ​ | [[Bool Type|Bool ]]  | If true, the dynamic attributes ​will be calculated. | True  | +| Extract Dynamic Attributes ​ | [[Boolean Value Type]] ​ | If true, dynamic attributes ​(null/​non-null cell counts, minimum, maximum, sum) are also extracted Yes  | 
-| Extract Statistical Attributes ​ | [[Bool Type|Bool ]]  | If true, statistical attributes ​will be calculated. | False  |+| Extract Statistical Attributes ​ | [[Boolean Value Type]] ​ | If true, statistical attributes ​(mean, variance, standard deviation, mode, median, unique count) are also extracted Yes  |
  
 ===== Outputs ===== ===== Outputs =====
  
-^ Name ^ Type ^ Description ^ +^ Name  ^ Type  ^ Description ​ 
-| Attributes | [[Lookup Table Type|Lookup ​Table ]]  | Table containing the attributes ​extracted from a map. |+| Attributes ​ | [[Lookup Table Type]]  ​| Table of extracted attributes, keyed by attribute code.  | 
 +| Layer Attributes ​ | [[Table Type]]  | Table of per-layer ​attributes, keyed by layer position in the map.  |
  
 ===== Group ===== ===== Group =====
Line 27: Line 28:
 ===== Notes ===== ===== Notes =====
  
-This functor analyzes all map layers. The resulting table refers ​to all of them.+Each attribute has a predefined name that can be used to retrieve it by name (rather than by numeric key) with the ''​tX["​NAME"​]''​ syntax in [[Calculate Map]], [[Calculate Categorical Map]], [[Calculate Value]], and the lookup table calculators.
  
-The functor employs a lookup table with keys to the attributes. Each key has predefined nameThis name can be used to retrieve ​the corresponding attribute in [[Calculate Map]], [[Calculate Categorical Map]], [[Calculate Value]] and [[Calculate Lookup Table]].+If an attribute cannot be determined, its entry is omitted from Attributes rather than being filled ​with a placeholderMinimum and maximum values are only determined when the map has at least one non-null cell.
  
-If it is not possible to determine any of these attributes, the corresponding entry in the lookup table is left blank. It determines the maximum and the minimum values only when there is at least one non null cell on the map.+**Basic ​attributes**
  
-==== Basic Attributes ====+^ Key  ^ Predefined Name  ^ Description ​ ^ 
 +| 1  | "​lines" ​ | number of lines  | 
 +| 2  | "​columns" ​ | number of columns ​ | 
 +| 3  | "​cells" ​ | lines times columns ​ | 
 +| 4  | "​layers" ​ | number of layers ​ | 
 +| 5  | "​cellHeight" ​ | cell height, in meters ​ | 
 +| 6  | "​cellWidth" ​ | cell width, in meters ​ | 
 +| 7  | "​cellArea" ​ | cell area, in hectares ​ | 
 +| 19  | "​cellType" ​ | cell type code, see Cell type codes below  | 
 +| 20  | "​nullValue" ​ | null value  | 
 +| 21  | "​registrationCoordinateY" ​ | registration coordinate Y  | 
 +| 22  | "​registrationCoordinateX" ​ | registration coordinate X  | 
 +| 23  | "​registrationCellY" ​ | registration cell Y  | 
 +| 24  | "​registrationCellX" ​ | registration cell X  | 
 +| 25  | "​rotationY" ​ | rotation Y  | 
 +| 26  | "​rotationX" ​ | rotation X  | 
 +| 27  | "​originalCellHeight" ​ | cell height as specified by the projection ​ | 
 +| 28  | "​originalCellWidth" ​ | cell width as specified by the projection ​ |
  
-^ Key ^ Predefined Name ^ Description ​                                                           ^ +**Dynamic attributes** ​(present only when Extract Dynamic Attributes is true), computed across all non-null cells of all layers:
-| 1   | "​lines" ​        | number of lines                                                        | +
-| 2   | "​columns" ​      | number of columns ​                                                     | +
-| 3   | "​cells" ​        | number of cells (number of lines multiplied by the number of columns). | +
-| 4   | "​layers" ​       | number ​of layers ​                                                      | +
-| 5   | "​cellHeight" ​   | cell height (in meters) ​                                               | +
-| 6   | "​cellWidth" ​    | cell width (in meters) ​                                                | +
-| 7   | "​cellArea" ​     | cell area (in hectares) ​                                               |+
  
-==== Dynamic attributes ====+^ Key  ^ Predefined Name  ^ Description ​ ^ 
 +| 8  | "​nullCells" ​ | number of null cells  | 
 +| 9  | "​nonNullCells" ​ | number of non-null cells  | 
 +| 10  | "​minCell" ​ | minimum value (excluding null cells) ​ | 
 +| 11  | "​maxCell" ​ | maximum value (excluding null cells) ​ | 
 +| 12  | "​cellSum" ​ | sum of the values (excluding null cells) ​ |
  
-^ Key ^ Predefined Name ^ Description ​                             ^ +**Statistical attributes** ​(present only when Extract Statistical Attributes is true), computed across all non-null cells of all layers:
-| 8   | "​nullCells" ​    | number of null cells                     | +
-| 9   | "​nonNullCells" ​ | number of non null cells                 | +
-| 10  | "​minCell" ​      | minimum value (excluding null cells    | +
-| 11  | "​maxCell" ​      | maximum value (excluding ​null cells)     | +
-| 12  | "​cellSum" ​      | sum of the values (excluding null cells) |+
  
-==== Statistical attributes ====+^ Key  ^ Predefined Name  ^ Description ​ ^ 
 +| 13  | "​meanCell" ​ | average (excluding null cells) ​ | 
 +| 14  | "​cellVar" ​ | variance (excluding null cells) ​ | 
 +| 15  | "​cellStd" ​ | standard deviation (excluding null cells) ​ | 
 +| 16  | "​modeCell" ​ | mode (excluding null cells) ​ | 
 +| 17  | "​medianCell" ​ | median (excluding null cells) ​ | 
 +| 18  | "​uniqueCells" ​ | total unique occurrences (excluding null cells) ​ |
  
-Key Predefined Name ^ Description ​                                    +**Cell type codes** used by attribute 19 ("​cellType"​):​ 
-13  ​| ​"​meanCell" ​     | average (excluding null cells) ​                 ​+ 
-14  ​| ​"​cellVar" ​      | variance (excluding null cells) ​                +Code  ​Cell Type  ​
-15  ​| ​"​cellStd" ​      standard deviation (excluding null cells) ​      + ​| ​Unsigned 1 Bit Integer  ​
-| 16  | "​modeCell" ​     ​mode (excluding null cells) ​                    + ​| ​Signed 8 Bit Integer  ​
-17  ​| ​"​medianCell" ​   ​median (excluding null cells) ​                  + ​| ​Unsigned 8 Bit Integer  ​| 
-18  | "uniqueCells" ​  | total unique occurrences ​(excluding null cells|+| 3  | Signed 16 Bit Integer  ​
 +4  | Unsigned ​16 Bit Integer ​ | 
 +5  | Signed 32 Bit Integer  ​
 + ​| ​Unsigned 32 Bit Integer  ​| 
 +| 7  | IEEE 754 32 Bit Real  ​
 + ​| ​IEEE 754 64 Bit Real  | 
 + 
 +Layer Attributes has columns ​"Layer_Index" (the layer'​s positionand "​Layer_Name"​ (the layer'​s name); currently the layer name is the only layer-specific attribute returned.
  
 ===== Internal Name ===== ===== Internal Name =====
  
 ExtractMapAttributes ExtractMapAttributes
 +
 +===== Usage examples =====
 +
 +See practical examples of this functor in [[lesson_6|Lesson 6: Extracting map attributes and basic statistics]]