This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Map Type ====== A **Map** represents a grid of cells — with a fixed number of lines and columns — associated with a map projection, datum, and registration coordinates that anchor the grid in real-world space, along with a cell size defining the grid resolution. A Map can optionally define a null value, and can optionally hold more than one named layer, each layer being its own independent raster sharing the same dimensions and geographic format (see [[Create Cube Map]] and [[Extract Map Layer]]). There are two basic kinds of maps: ===== Categorical Maps ===== Maps whose cells represent classes or categories — vegetation type, soil type, sub-regions, and similar. A map becomes a Categorical Map when a [[Categorization Type|Categorization]] is attached to it, associating its integer cell values with category names and colors. [{{ :categorical_map.png?nolink |Categorical map example: a map depicting land use}}] ===== Non-Categorical Maps ===== Maps whose cells represent values — temperature, probabilities, distances, and similar. A Non-Categorical Map carries no Categorization. [{{ :non_categorical_map.png?nolink |Non-categorical map example: a map depicting probabilities}}] ===== GUI Editor ===== Input [[ego_script#ports|ports]] of type Map are non-editable, so a map cannot be defined using an editor in the graphical interface. A Map value must always come from connecting an output produced by another functor — a loader such as [[Load Map]], or a calculator such as [[Calculate Map]] — supplied by wiring that output to the input. ===== EGO Script ===== For the same reason, input [[ego_script#ports|ports]] of type Map cannot receive a constant in [[EGO Script]] — see [[ego_script#constants|Constants]]. A Map is always obtained by calling a functor that produces one, and reused by referencing the variable bound to its output: <code> // Loads a map, computes its slope, and saves the result. elevation := LoadMap "c:/data/elevation.tif"; slope := CalcSlopeMap elevation; SaveMap slope "c:/data/slope.tif"; </code> The generic [[Map]] carrier functor exists purely to pass a Map connection through — for example, as a placeholder while wiring a model — but its own input is likewise non-editable; it must itself be connected to another functor's Map output. ===== Storage ===== How a map's cells are actually kept — fully in memory, as a sparse mapping of only non-null cells, or paged from disk on demand — is a storage detail separate from the map's content, and never changes the map's values. Depending on the functor producing the map, this can be controlled explicitly or left for the runtime to decide: * **Loaders** such as [[Load Map]] and [[Load Categorical Map]] expose a ''storageMode'' input offering the full range of choices: ''.default'' (use the global memory allocation policy), ''.preferMemory'' (load fully into memory), ''.preferDisk'' (page from disk on demand), or ''.loadAsSparse'' (store only non-null cells). * **Most functors that create or calculate a map** — such as [[Create Map]], [[Create Categorical Map]], [[Calculate Map]], and [[Calc Slope Map]] — expose a simpler Boolean flag that forces the output to be stored as sparse when true, or fully in memory when false. The flag's name varies by functor (''createAsSparse'', ''resultIsSparse'', ''slopeIsSparse'', and similar). Since these functors compute their map's cells directly rather than reading them from an existing file, they have no on-disk paging option — that only applies to a map already backed by a file, as with the loaders above. * When a functor exposes no storage-related input at all, the runtime chooses the storage strategy automatically — the same choice ''.default'' makes for a loaded map. ===== Automatic Conversions ===== * **Converted from**: [[Categorical Map Type]] — this is **subtyping**, not a registered conversion: a Categorical Map is already, structurally, a Map, so no conversion logic actually runs. Its cell values, null value, and categorization all carry over untouched; only the guarantee that a categorization is present is dropped, since a plain Map's categorization is optional. The reverse does not happen automatically: a plain Map is not accepted where a Categorical Map is required, since that guarantee can't be manufactured from nothing. * **Converted to**: [[Projection Type]]. See [[type_system|Type System]] for the complete conversion reference across all types, including which conversions are subtyping versus registered converters.