Skip to content

MIKE+ Global Utility

GeoAPIHelper

Purpose and scope

GeoAPIHelper utility class provides all the geometry manipulation related methods for global usage. It also contains all the geo unit conversion methods. Most of the methods are straightforward.

APIs Category

Using DHI.Amelia.Infrastructure.Interface.UtilityHelper to get access to GeoAPIHelper.

  • Unit conversion APIs: #region Unit conversion.
  • Geometry creation APIs: #region Geometry creation
  • Geometry conversion APIs: #region Geometry conversion
  • Geo Helper APIs: #region Help methods

APIs implications/conventions

There are some conversions which apply for all the APIs in this class. By default: For Geometry conversion APIs, there is an implicated unit conversion which will apply. The unit conversion assumes that for all parameters of those APIs:

  • WKB is in base unit.
  • IGeometry is also in base unit by default.
  • All the other MIKE+ defined Geo-Type is in base unit by default.

But for convenience, most of those APIs have a default unit conversion flag, which user can set if the default unit conversion behavior is not desired. This conversion of API parameters should be respected when extending other APIs if possible.

Unit system

Purpose and scope

MIKE+ has a sophisticated unit system requirement for different models. Each model has its own unit system and works independently. The unit system used is defined in the database, but the unit system configurations are defined outside of the database (In some text files here: MIKE+ installer folder/Templates/Units/).

Definitions

In MIKE+ database, all the data are stored in base unit (unchanged). There is a list of unit configuration files where all the database field base and user units are defined. User can switch between different unit system on the fly in MIKE+.

MIKE+ unit system is based on the MIKE Zero EUM system and all the unit conversion is also based on the EUM unit APIs. Each field has a EUM type with it and the base and user unit should be valid for this EUM type Dynamic field EUM types are defined by a set of ctrl value, which normally is defined in domain ENUM type. Custom ctrl value is determined at runtime (not hard coded).

Unit scope boundary

Unit scope:

  • All GUI Views and GUI utility (client side): Recommended all data are processed in base unit.
  • For map symbology, all data should be converted to user unit when displayed.
  • Tool engine: All data must be processed in base unit.
  • DomainService: Recommend all data are processed in base unit.
  • DataTables: All data must be processed in base unit, but all the dataTables APIs by default accept all the parameters in user unit. (unit conversion needed at entry point)
  • Command: All data must be processed in base unit in command implementation.
  • DataSource: All data must be processed in base unit.

Unit boundary:

If cross unit scopes, all the APIs between two scopes must be used carefully to make sure to pass data in proper unit and proper unit conversion APIs are used.