This is an old revision of the document!
Type System
Overview
Every port has a type, and a port accepts data of its exact type, or any other type for which an automatic conversion to that type has been registered. Each type in this system is implemented by a dedicated type class, named after the data it represents with a Type suffix — for instance, Region Manager Type is the type class backing the region manager data. This page refers to every type by that full class name and links each one to its own page.
See Ports on the EGO Script page for how a port's type governs what it can receive, and Basic Data Flow for the general rule this page's conversions follow.
How automatic conversion works
Automatic type conversion only happens when a value is connected from one port to another — a variable reference, or a functor call inlined directly into an argument. It never applies to a constant written directly into a port; a constant is instead parsed by the receiving port's own type-specific literal syntax, which accepts only that type's own literal form. See Constants for this rule in full.
Conditional conversions. A handful of conversions only succeed if the source value actually holds data compatible with the target type at runtime, raising an error otherwise — converting an already-typed, known value never fails, but converting a generic holder type (such as Table Value Type) does depend on what it actually contains. Table Value Type → String Type and Table Value Type → Real Value Type are the clearest examples: each only succeeds if the Table Value Type value actually holds that type. Wrapping such a conversion in Skip On Error turns the failure into a type test — see Manipulating Tables and Lookup Tables for a full worked example of this pattern.
Sequencing. A conversion to None Type is registered for almost every type in the system. This isn't meant to transform data — it's the standard way to force an execution order between two functors that otherwise share no data dependency: connecting an output to a None Type-typed input creates a dependency edge without needing the value itself, so the engine schedules the connected functor to run after the one that produced it. The types that support this are listed separately in Sequencing below, rather than repeated in every table.
Value types
Filename and text types
Table and Lookup Table types
Map and raster types
Simulation types
Calibration types
Region types
Region Manager Type has no automatic conversions to or from any other type — the only conversion registered for it is the sequencing conversion to None Type described below.
Sequencing
A conversion to None Type — used to force an execution order between two functors rather than to transform a value — is registered for the following types:
Connection Info Type, Boolean Value Type, Code Type, Date Type, Enum Type, Folder Type, Generic Filename Type, Image Expression Type, Index Or Name Type, Int Set Type, Integer Value Type, Log Tag Type, Name Type, Non Negative Integer Value Type, Null Value Type, Percent Type, Positive Integer Value Type, Real Value Type, String Type, Struct Type, Workdir Type, Categorical Map Type, Categorization Type, Cell Type, Kml Type, Kml Timeline Type, Kmz Filename Type, Map Type, Map Filename Type, Projection Type, Weights Of Evidence Skeleton Type, Change Matrix Type, Neighborhood Table Type, Percent Matrix Type, Transition Function Parameter Matrix Type, Transition Matrix Type, Transition Set Type, Weights Type, Weights Filename Type, Elevation Graph Type, Region Manager Type, Base Table Type, Lookup Table Type, Lookup Table Filename Type, Lookup Table Group Type, Table Filename Type, Table Type, Table Manager Type, Table Value Type, Tuple Type
See also
- EGO Script — ports, constants, and where automatic conversion applies
- Basic Data Flow — the general connection/constant distinction
- Manipulating Tables and Lookup Tables — worked example of a conditional conversion used as a type test
- Map Type and Lookup Table Type — the shapes these types accept