This is an old revision of the document!


PHP's gd library is missing or unable to create PNG images

Image Virtualization

Image virtualization, map virtualization, or even raster virtualization is the name given by Dinamica EGO 4 to the ability of manipulating images with different extents, resolutions or number of lines and columns.

Previous versions of Dinamica required all maps used as inputs of a model to have the same number of lines and columns (and by consequence the same extents). Dinamica EGO 4 changed this behavior by enforcing the proper use of map projections (all maps used as part of a model must share the same projection) and registration coordinates.

Requirements

Map computations in Dinamica since version 4 uses image virtualization to extent and modify at runtime the image dimensions making sure that all images presented to any operator have the same number of lines and columns. This allows images used by any computation to have different dimensions while retaining the ability to run the calculation in parallel at high speed.

Typically, the only requirement when using virtualization is that all images must share the same projection, although different models can use different projections. It is also possible to use maps with different projections as part of a same model, as long as images with different projections are not given as inputs to the same functors at the same time.

To facilitate the re-projection of maps ensuring that the projections are the same, a convenient wrapper around the gdal_warp and gdal_translate called Transform Map is provided. This functor simply runs those GDAL utilities distributed with Dinamica EGO 4.

All analysis concerning projections and what they represent are performing internally using GDAL. However, the map virtualization itself is performing independently by Dinamica.

Virtualization Explained

Versions of Dinamica prior to version 4 could only manipulate maps with the same number of lines and columns. Additional information such as registrations coordinates, resolution etc were not treated uniformly by all functors with many of them simply ignoring this information in the input maps.

Version 4 handles map extents and resolution in a very uniform way. Basically, when a set of maps is given to a functor, they are first analysed to determine what is the minimum extents and resolution that an input map should have to cover all necessary cells the best possible way. Then, each input map is wrapped around a virtual version of itself with this new resolution and extents. The functor receives those virtual version and use them to perform the computation. By using this virtualization process, version 4 ensures that all maps given to a functor have the same number of lines and columns, resolution, and extents. It is also worth noting that a same map might have different virtual representation depending on the original set of maps given to a particular functor.

The virtual resolution of the resulting virtual maps is always the smallest resolution from all maps involved in the visualization process. This minimizes the number of cells that have to be analyzed when decided to what original cell a virtual cell from the virtual map corresponds.

Controlling Virtualization

The virtualization process is mostly automatic and happens by simply passing maps with different extents and resolutions to any functor. However, the user can limit the virtualzation process by checking the options available on Tools → Options | Advanced | Virtualization. Basically, the user can choose one of the following options.

  • Off: Raster map virtualization will be completely disabled. This is equivalent of running a simulation using a previous version of Dinamica EGO. If the maps used by the functors are incompatible, the execution might or might nor work, depending on how the functor behaves internally.
  • Not Allowed: If the simulation needs raster map virtualization to run, an error will be reported. Otherwise, the simulation will run as if using a previous version of Dinamica EGO.
  • Unrestricted: If necessary, raster map virtualization will be used to run the simulations, even if its use results in very large maps compared to the dimensions of the input maps.
  • Limited: Raster map virtualization will be used, but only if its use does not result in very large maps compared to the dimensions of the input maps. Otherwise, an error will be reported.

Limitations

Functors Calc Cost Allocation Map and Calc Pathway Map will always report an error if virtualization is required to make their input maps compatible. The reason behind this behavior is simple: virtualization often replicates a cell turning it into many cells with the same value when the resolution of a map increases, but these functors need the input cost map not to have local minimums. Thus, replicating a cell would create local minimum and that would prevent these functors from working properly.