GIS Module¶
The GIS manager provides the ability to work with GIS maps within the Workbench. It offers a number of visualization options as well as tools for spatial processing.
Install the NuGet package DHI.MikeOperations.GISManager to get access to the GIS module API.
// Get the GIS module.
var module = application.Modules.Get("GIS Manager") as DHI.Solutions.GISManager.Interfaces.IGISModule;
// Fetch all feature classes.
var featureClassList = module.FeatureClassList.FetchAll();
// Fetch a single feature class from its path in the the GIS manager.
var featureClass = module.FeatureClassList.Fetch("/Sava/Rivers");
// Fetch all features of a feature class.
var featureList = featureClass.FetchAll();
# Get the GIS module.
module = app.Modules.Get("GIS Manager")
# Fetch all feature classes.
featureClassList = module.FeatureClassList.FetchAll()
# Fetch a single feature class from its path in the the GIS manager.
featureClass = module.FeatureClassList.Fetch("/Sava/Rivers")
# Fetch all features of a feature class.
featureList = featureClass.FetchAll()
# Get the GIS module.
module = DHI.Solutions.GISManager.Interfaces.IGISModule(app.Modules.Get("GIS Manager"))
# Fetch all feature classes.
featureClassList = module.FeatureClassList.FetchAll()
# Fetch a single feature class from its path in the the GIS manager.
featureClass = module.FeatureClassList.Fetch("/Sava/Rivers")
# Fetch all features of a feature class.
featureList = featureClass.FetchAll()
Module Providers¶
The following providers are included in the GIS module.
| Provider | Description |
|---|---|
| FeatureClassList | Manage feature classes (vector data) |
| FeatureClassGroupList | Manage feature class groups |
| FeatureClassAttributeList | Manage feature class attributes |
| MeshList | Manage meshes (unstructured data) |
| MeshGroupList | Manage mesh groups |
| RasterList | Manage rasters (grids) |
| RasterGroupList | Manage raster groups |
Read more about using module providers here
Working with feature attributes¶
Feature classes uses attributes and attribute values to store feature data.
// Fetch a single feature class from its path in the the GIS manager.
var featureClass = module.FeatureClassList.Fetch("/Sava/Catchments");
// Create a new attribute
var newAttribute = featureClass.AttributeList.CreateNew();
newAttribute.Name = "myattribute";
newAttribute.Type = typeof(string);
newAttribute.MaxLength = 50;
featureClass.AttributeList.Add(newAttribute);
// Loop all features of the feature class
var featureList = featureClass.FetchAll();
foreach (var feature in featureList)
{
// Set the attribute value of the feature (value, index)
feature[newAttribute] = "attrVal";
// Get the attribute value of the feature
var attributeValue = feature[newAttribute];
}
featureClass.Update(featureList);
" Fetch a single feature class from its path in the the GIS manager.
featureClass = module.FeatureClassList.Fetch("/Sava/Catchments")
# Create a new attribute
newAttribute = featureClass.AttributeList.CreateNew()
newAttribute.Name = "myattribute"
newAttribute.Type = typeof(string)
newAttribute.MaxLength = 50
featureClass.AttributeList.Add(newAttribute)
# Loop all features of the feature class
featureList = featureClass.FetchAll();
for feature in featureList:
# Set the attribute value of the feature (value, index)
feature[newAttribute] = "attrVal"
# Get the attribute value of the feature
attributeValue = feature[newAttribute]
featureClass.Update(featureList)
Using Queries¶
Query Properties¶
Feature Class¶
Query properties supported when querying on feature classes in the FeatureClassList provider.
| Query Property | Type | Database Column | Note |
|---|---|---|---|
| DefaultSymbology | string | default_symbology | |
| DisplayAttribute | string | display_field | |
| GroupId | Guid | group_id | |
| Id | Guid | id | |
| Name | string | name | |
| TableName | string | table_name | From MIKE OPERATIONS 2023.1 |
Raster¶
Query properties supported when querying on rasters in the RasterList provider.
| Query Property | Type | Database Column | Note |
|---|---|---|---|
| DefaultSymbology | string | default_symbology | |
| EumType | int | eum_type | From MIKE OPERATIONS 2023.1 |
| EumUnit | int | eum_unit | From MIKE OPERATIONS 2023.1 |
| GroupId | Guid | group_id | |
| Id | Guid | id | |
| IsTemporal | bool | istemporal | |
| Name | string | name | |
| TableName | string | table_name | From MIKE OPERATIONS 2023.1 |
| Version | Guid | version |
Mesh¶
Query properties supported when querying on meshes in the MeshList provider.
| Query Property | Type | Database Column | Note |
|---|---|---|---|
| GroupId | Guid | group_id | |
| Id | Guid | id | |
| Name | string | name | |
| Version | Guid | version |
Remote Data Providers¶
Remote DFS2¶
This provider provides access to DFS2 files on disk.
NuGet package: DHI.MikeOperations.GISManager.Provider.RemoteDfs2
// Get the GIS module.
var module = application.Modules.Get("GIS Manager") as DHI.Solutions.GISManager.Interfaces.IGISModule;
// Use a provider configured in MIKE Workbench or add a new provider runtime
var provider = module.RasterDataProviders.Single(p => p.Name == "Remote File Based Raster Provider");
# Get the GIS module.
module = app.Modules.Get("GIS Manager")
# Use a provider configured in MIKE Workbench or add a new provider runtime
provider = next((p for p in module.RasterDataProviders if p.Name == "Remote File Based Raster Provider"), None)
# Get the GIS module.
module = DHI.Solutions.GISManager.Interfaces.IGISModule(app.Modules.Get("GIS Manager"))
# Use a provider configured in MIKE Workbench or add a new provider runtime
provider = next((p for p in module.RasterDataProviders if p.Name == "Remote File Based Raster Provider"), None)
Mesh Database (PostgreSQL)¶
This provider allows managing meshes stored in the MIKE OPERATIONS PostgreSQL database.
NuGet package: DHI.MikeOperations.GISManager.Provider.MeshDatabase
// Get the GIS module.
var module = application.Modules.Get("GIS Manager") as DHI.Solutions.GISManager.Interfaces.IGISModule;
// Use a provider configured in MIKE Workbench or add a new provider runtime
var provider = module.MeshDataProviders.Single(p => p.Name == "MeshDatabase MeshData Provider");
# Get the GIS module.
module = app.Modules.Get("GIS Manager")
# Use a provider configured in MIKE Workbench or add a new provider runtime
provider = next((p for p in module.MeshDataProviders if p.Name == "MeshDatabase MeshData Provider"), None)
# Get the GIS module.
module = DHI.Solutions.GISManager.Interfaces.IGISModule(app.Modules.Get("GIS Manager"))
# Use a provider configured in MIKE Workbench or add a new provider runtime
provider = next((p for p in module.MeshDataProviders if p.Name == "MeshDatabase MeshData Provider"), None)
MIKE Cloud GIS¶
Use this provider for accessing the MIKE Cloud GIS storage.
NuGet package: DHI.MikeOperations.GISManager.Provider.MikeCloud.GIS
// Get the GIS module.
var module = application.Modules.Get("GIS Manager") as DHI.Solutions.GISManager.Interfaces.IGISModule;
// Use a provider configured in MIKE Workbench or add a new provider runtime
var provider = module.GISDataProvides.Single(p => p.Name == "MIKE Cloud GIS Provider");
# Get the GIS module.
module = app.Modules.Get("GIS Manager")
# Use a provider configured in MIKE Workbench or add a new provider runtime
provider = next((p for p in module.GISDataProvides if p.Name == "MIKE Cloud GIS Provider"), None)
# Get the GIS module.
module = DHI.Solutions.GISManager.Interfaces.IGISModule(app.Modules.Get("GIS Manager"))
# Use a provider configured in MIKE Workbench or add a new provider runtime
provider = next((p for p in module.GISDataProvides if p.Name == "MIKE Cloud GIS Provider"), None)
MIKE Cloud Raster¶
Use this provider for accessing the MIKE Cloud Raster storage (MDS).
NuGet package: DHI.MikeOperations.GISManager.Provider.MikeCloud.Raster
// Get the GIS module.
var module = application.Modules.Get("GIS Manager") as DHI.Solutions.GISManager.Interfaces.IGISModule;
// Use a provider configured in MIKE Workbench or add a new provider runtime
var provider = module.RasterDataProviders.Single(p => p.Name == "MIKE Cloud Raster Provider");
# Get the GIS module.
module = app.Modules.Get("GIS Manager")
# Use a provider configured in MIKE Workbench or add a new provider runtime
provider = next((p for p in module.RasterDataProviders if p.Name == "MIKE Cloud Raster Provider"), None)
# Get the GIS module.
module = DHI.Solutions.GISManager.Interfaces.IGISModule(app.Modules.Get("GIS Manager"))
# Use a provider configured in MIKE Workbench or add a new provider runtime
provider = next((p for p in module.RasterDataProviders if p.Name == "MIKE Cloud Raster Provider"), None)
MIKE Cloud Mesh¶
Use this provider for accessing the MIKE Cloud Mesh storage (MDS).
NuGet package: DHI.MikeOperations.GISManager.Provider.MikeCloud.Mesh
// Get the GIS module.
var module = application.Modules.Get("GIS Manager") as DHI.Solutions.GISManager.Interfaces.IGISModule;
// Use a provider configured in MIKE Workbench or add a new provider runtime
var provider = module.MeshDataProviders.Single(p => p.Name == "MIKE Cloud Mesh Provider");
# Get the GIS module.
module = app.Modules.Get("GIS Manager")
# Use a provider configured in MIKE Workbench or add a new provider runtime
provider = next((p for p in module.MeshDataProviders if p.Name == "MIKE Cloud Mesh Provider"), None)
# Get the GIS module.
module = DHI.Solutions.GISManager.Interfaces.IGISModule(app.Modules.Get("GIS Manager"))
# Use a provider configured in MIKE Workbench or add a new provider runtime
provider = next((p for p in module.MeshDataProviders if p.Name == "MIKE Cloud Mesh Provider"), None)
Service¶
Use this provider to access remote WMS services.
NuGet package: DHI.MikeOperations.GISManager.Provider.Service
Tools¶
When using the API for running tools, every tool are following the concept show below.
// Get the tool from the tool name.
var tool = application.Tools.CreateNew("ASCII Grid File Export Tool") as DHI.Solutions.GISManager.Tools.ASCIIGridFileExportTool.IASCIIGridFileExportTool;
// Add input items to the tool.
tool.InputItems.Add(raster);
// Set the properties of the tool.
tool.FilePath = @"c:\file.txt";
// Execute the tool.
tool.Execute();
// Get the output of the tool (if any).
var output = tool.OutputItems[0];
# Get the tool from the tool name.
tool = app.Tools.CreateNew("ASCII Grid File Export Tool")
# Add input items to the tool.
tool.InputItems.Add(raster)
# Set the properties of the tool.
tool.FilePath = "c:/file.txt"
# Execute the tool.
tool.Execute()
# Get the output of the tool (if any).
output = tool.OutputItems[0]
# Get the tool from the tool name.
tool = DHI.Solutions.GISManager.Tools.ASCIIGridFileExportTool.IASCIIGridFileExportTool(app.Tools.CreateNew("ASCII Grid File Export Tool"))
# Add input items to the tool.
tool.InputItems.Add(raster)
# Set the properties of the tool.
tool.FilePath = "c:/file.txt"
# Execute the tool.
tool.Execute()
# Get the output of the tool (if any).
output = tool.OutputItems[0]
ASCII Grid File Export Tool¶
The ASCII Grid File Export Tool exports an input raster to an ESRI ASCII file with a associated .prj file containing projection information.
| Tool Info | ASCII Grid File Export Tool |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.ASCIIGridFileExport |
| API Reference | DHI.Solutions.GISManager.Tools.ASCIIGridFileExportTool.IASCIIGridFileExportTool |
| Input Items | A single raster |
| Output Items | No output items |
Tool Properties
- RasterBand: Gets or sets the index of the raster band in the raster to get values from
- FilePath: Gets or sets file path of exported file.
- ExportMetadata: Gets or sets a value indicating whether the metadata of the entity should be exported.
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("ASCII Grid File Export Tool") as DHI.Solutions.GISManager.Tools.ASCIIGridFileExportTool.ASCIIGridFileExportTool;
// Set the tool properties and execute.
var gisModule = application.Modules.Get("GIS Manager") as DHI.Solutions.GISManager.Interfaces.IGISModule;
var raster = gisModule.RasterList.Fetch("/group/raster");
tool.InputItems.Add(raster);
tool.FilePath = @"c:\temp\export_grid.asc";
tool.Execute();
Buffer¶
Calculates a polygon representing the buffer around the input geometry(ies) at the given distance, inclusive of the input geometry(ies) area. The output will be a feature class with a single polygon feature.
| Tool Info | Buffer |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.GeoProcessing |
| API Reference | DHI.Solutions.GISManager.Tools.GeoProcessing.IBufferTool |
| Input Items | A single features or a single feature class |
| Output Items | A feature class |
Tool Properties
- GISProcessor: Gets or sets the GIS processor to use when executing the tool
- Distance: Gets or sets the distance from the geometry where the buffer will be calculated
- Unit: Gets or sets the unit for the distance
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Buffer") as DHI.Solutions.GISManager.Tools.GeoProcessing.BufferTool;
// Create a features object containing features.
var gisModule = application.Modules.Get(typeof(DHI.Solutions.GISManager.Interfaces.IGISModule)) as DHI.Solutions.GISManager.Interfaces.IGISModule;
var featureClass = gisModule.FeatureClassList.Fetch("/Sava/Reservoirs");
var featureList = featureClass.FetchAll();
var features = new DHI.Solutions.GISManager.Business.Features();
features.Add(featureList);
// Add input, set properties and execute the tool.
tool.InputItems.Add(features);
tool.Distance = 1;
tool.Unit = DHI.Solutions.GISManager.Interfaces.DisplayUnit.Kilometer;
tool.Execute();
// Get the output of the tool.
var outputFeatureClass = tool.OutputItems[0] as DHI.Solutions.GISManager.Interfaces.IFeatureClass;
Catchment Rainfall Generation Tool¶
The Catchment Rainfall Generation tool, combines the two tools “Time Series to Temporal Raster” and “Temporal Zonal Statistics Tool” into one tool calling the two tools in sequence to calculate feature statistics.
- Creates a new raster based on time series associated to point features in a feature class using the “Time Series to Temporal Raster” tool.
- Based on the created raster, calculate statistics for every feature(polygon, lines or points) in a feature class using the “Temporal Zonal statistics” tool.
Note that the “Catchment Rainfall Generation Tool” uses the same feature class as input for both tools, hence only point feature classes are supported. Refer to the “Time Series to Temporal Raster” tool and the “Temporal Zonal statistics” tool for more information.
| Tool Info | Catchment Rainfall Generation Tool |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.TemporalRaster |
| API Reference | DHI.Solutions.GISManager.Tools.Temporal.ICatchmentRainfallGenerationTool |
| Input Items | A single feature class |
| Output Items | No output items |
Tool Properties
- TSNamePattern: Gets or sets a regular expression used to filter timeseries by name. If this is left empty, the tool will assume a one to one match between the names written in the attribute table and the timeseries names.
- TSGroupName: Gets or sets the time series group name.
- UseAssociation: Gets or sets a value indicating whether the last timestep from the selected timeseries are written to the attribute table. If set to False, the timestep to pick will need to be specified. If the timestep does not exist, the value will be Null.
- TsNameFeatureAttributeName: Gets or sets the value of TS name feature attribute
- StartTime: Gets or sets the minimum possible start time of the temporal output raster. If timeseries do not have timesteps at this particular date/time, no interpolation is carried out and the raster will start at first available timestep (following StartTime).
- EndTime: Gets or sets the end maximum possible end time of the temporal output raster. If timeseries do not have timesteps at this particular date/time, no interpolation is carried out and the raster will end at last available timestep (preceding EndTime).
- TimeStep: Gets or sets the timestep of the output raster. This should match the input timeseries timestep. The tool looks for a given timestep in each input timeseries. If it not found, MissingValue is used.
- RasterDefinition: Gets or sets the definition of the output raster. The editable properties correspond to the raster properties, as defined in World Files. This includes the extent, rotation, cell size and origin of the raster to create. The extent is by default taken from the feature class extent. Scale X and Scale Y correspond to the cell size for a raster that is not rotated. The Scale Y is negative because the origin of the raster is the top left corner. The read only properties are derived from the editable properties.
- AutoScale: Gets or sets a value indicating whether the tool will automatically adjust the width/height or the scale to keep the overall extent equal to the input extent. Changing the width/height will automatically change the scale or vice-versa.
- RasterName: Gets or sets the name of the output raster. If it already exists, it will be overwritten.
- TimeSeriesValueType: Gets or sets the value of time series value type.
- TimeSeriesVariable: Gets or sets the variable described by the time series. Each variable will have a set of allowed units, and hence changing the variable can potentially change the list of available units.
- TimeseriesUnit: Gets or sets the unit of the output time series. Only allowed units are available in the list. The allowed units are defined by the variable type.
- CatchmentsFeatureClassName: Gets or sets the full path to the feature class obtaining catchment polygons.
- CatchmentTSAttributeName: Gets or sets the attribute name of the catchment feature to be used for naming of result time series names.
- RasterGroup: Gets or sets the value of raster group
- OutputTSGroup: Gets or sets the group in which to save the timeseries (in format: /Group1/Group2). If this field is left empty, series will be saved in the root.
- NameSuffix: Gets or sets the suffix added to all time series names. If left empty, no suffix will be added.
- SelectedStatistic: Gets or sets the statistics to be used in Zonal Statistic computation.
- AssociateTsToFeatures: Gets or sets a value indicating whether output rainfall should be associated to features in the input feature class.
- InterpolationMethod: Gets or sets the value of the interpolation method
- AddAssociation: Gets or sets a value indicating whether an association should be added.
- TimeStepUnit: Gets or sets the time step unit (second, minute, day ...)
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Catchment Rainfall Generation Tool") as DHI.Solutions.GISManager.Tools.Temporal.CatchmentRainfallGenerationTool;
// Set the tool properties and execute.
var gisModule = application.Modules.Get("GIS Manager") as DHI.Solutions.GISManager.Interfaces.IGISModule;
var featureClass = gisModule.FeatureClassList.Fetch("/TemporalTest");
tool.InputItems.Add(featureClass);
tool.AddAssociation = false;
tool.UseAssociation = false;
tool.TSNamePattern = @"([\w\s\d\.]*)_rainfall";
tool.TsNameFeatureAttributeName = "tsname";
tool.TimeStep = 1;
tool.AutoScale = true;
tool.RasterName = "outputraster";
tool.RasterGroup = "/temprasters";
tool.TSGroupName = "/tsdata";
tool.RasterDefinition.Height = 100;
tool.StartTime = new DateTime(1961, 8, 24, 0, 0, 0);
tool.EndTime = new DateTime(1961, 8, 24, 8, 0, 0);
tool.CatchmentsFeatureClassName = "/TemporalCatchment";
tool.CatchmentTSAttributeName = "catchname";
tool.TimeseriesUnit = "mm";
tool.TimeSeriesValueType = DHI.Solutions.Generic.DataSeriesValueType.Step_Accumulated;
tool.TimeSeriesVariable = "Rainfall";
tool.OutputTSGroup = "/catchTS";
tool.NameSuffix = "_catch";
tool.Execute();
// Get the output of the tool.
Clip Feature Classes¶
A tool for clipping a feature class to the features of another.
| Tool Info | Clip Feature Classes |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.GeoProcessing |
| API Reference | DHI.Solutions.GISManager.Tools.GeoProcessing.IClipTool |
| Input Items | Two feature classes |
| Output Items | A feature class |
Tool Properties
- GISProcessor: Gets or sets the GIS processor to use when executing the tool
- ClippedFeatureClassName: Gets or sets name of the new clipped feature class
- FeatureClassToClipTo: Gets or sets the feature class to clip to. This feature class shall be of polygon type.
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Clip Feature Classes") as DHI.Solutions.GISManager.Tools.GeoProcessing.ClipTool;
// Set the tool properties and execute.
var gisModule = application.Modules.Get("GIS Manager") as DHI.Solutions.GISManager.Interfaces.IGISModule;
var cities = gisModule.DefaultGISDataProvider.FeatureClassList.Fetch("/Cities");
var polygon = gisModule.DefaultGISDataProvider.FeatureClassList.Fetch("/1Polygon");
tool.InputItems.Add(cities);
tool.InputItems.Add(polygon);
tool.FeatureClassToClipTo = polygon;
tool.ClippedFeatureClassName = "ClippedCities";
tool.Execute();
// Get the output of the tool.
var output = tool.OutputItems[0] as DHI.Solutions.GISManager.Interfaces.IFeatureClass;
Create Gif from Temporal Raster¶
The tool exports animated Gif files from temporal rasters. The tool is designed to be called from code, and not executed from the Platform Shell. This is because the tool output items are comprised of two .NET image objects, and a .Net class containing geographic extent information.
| Tool Info | Create Gif from Temporal Raster |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.GifFileExport |
| API Reference | DHI.Solutions.GISManager.Tools.TemporalRasterToGifTool.ITemporalRasterToGifTool |
| Input Items | A single raster |
| Output Items | No output items |
Tool Properties
- OutputFolder: Gets or sets file path of exported file.
- RasterPath: Gets or sets GIS Manager temporal raster path
- ToolMode: Gets or sets the mode that the tool should run with.
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Create Gif from Temporal Raster") as DHI.Solutions.GISManager.Tools.TemporalRasterToGifTool.TemporalRasterToGifTool;
// Set the tool properties and execute.
var module = application.Modules.Get("GIS Manager") as DHI.Solutions.GISManager.Interfaces.IGISModule;
var raster = module.RasterList.Fetch("/Aladin_4km");
tool.InputItems.Add(raster);
tool.OutputFolder = @"c:\temp";
tool.RasterPath = "/Aladin_4km";
tool.ToolMode = DHI.Solutions.GISManager.Tools.TemporalRasterToGifTool.ToolMode.RasterGif;
tool.Execute();
DFS2 File Export Tool¶
Tool for exporting a raster to a dfs2 file.
| Tool Info | DFS2 File Export Tool |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.Dfs2TemporalRasterFileExport |
| API Reference | DHI.Solutions.GISManager.Tools.DFS2TemporalRasterFileExportTool.IDFS2TemporalRasterFileExportTool |
| Input Items | A single raster |
| Output Items | No output items |
Tool Properties
- FilePath: Gets or sets file path of exported dfs2 file.
- ExportMetadata: Gets or sets a value indicating whether the metadata of the entity should be exported.
- Start_Time: Gets or sets the start time of time steps of the temporal raster to be exported. If the start time is not set, all time steps are exported.
- Enum_Item: Gets or sets the enum item. By default taken from the input raster.
- Enum_Unit: Gets or sets the enum unit. By default taken from the input raster.
- CoordinateSystemAsString: Gets or sets the coordinate system as string. By default, the source coordinate system of the input raster is used.
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("DFS2 File Export Tool") as DHI.Solutions.GISManager.Tools.DFS2TemporalRasterFileExportTool.DFS2TemporalRasterFileExportTool;
// Set the tool properties and execute.
var module = application.Modules.Get("GIS Manager") as DHI.Solutions.GISManager.Interfaces.IGISModule;
var raster = module.RasterList.Fetch("/Aladin_4km");
tool.InputItems.Add(raster);
tool.FilePath = @"c:\temp\aladin.dfs2";
tool.Execute();
Dissolve Feature Class¶
The Dissolve tool combines multiple polygons with identical attribute values (user selected attribute) into a single feature.
| Tool Info | Dissolve Feature Class |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.GeoProcessing |
| API Reference | DHI.Solutions.GISManager.Tools.GeoProcessing.IDissolveTool |
| Input Items | A single feature class |
| Output Items | A feature class |
Tool Properties
- GISProcessor: Gets or sets the GIS processor to use when executing the tool
- Attribute: Gets or sets the attribute to dissolve on.
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Dissolve Feature Class") as DHI.Solutions.GISManager.Tools.GeoProcessing.DissolveTool;
// Set the tool properties and execute.
tool.InputItems.Add(featureClass);
tool.Attribute = "Attrib1";
tool.Execute();
// Get the output of the tool.
var outputFeatureClass = tool.OutputItems[0] as DHI.Solutions.GISManager.Interfaces.IFeatureClass;
Erase Feature Classes¶
A tool for erasing a feature class to the features of another.
| Tool Info | Erase Feature Classes |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.GeoProcessing |
| API Reference | DHI.Solutions.GISManager.Tools.GeoProcessing.IEraseTool |
| Input Items | Two feature classes |
| Output Items | A feature class |
Tool Properties
- GISProcessor: Gets or sets the GIS processor to use when executing the tool
- ErasedFeatureClassName: Gets or sets name of the new erased feature class
- FeatureClassToErase: Gets or sets the feature class to erase from the other. This feature class shall be of polygon type.
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Erase Feature Classes") as DHI.Solutions.GISManager.Tools.GeoProcessing.EraseTool;
// Set the tool properties and execute.
var cities = _gisModule.DefaultGISDataProvider.FeatureClassList.Fetch("/Cities");
var polygon = _gisModule.DefaultGISDataProvider.FeatureClassList.Fetch("/1Polygon");
tool.InputItems.Add(cities);
tool.InputItems.Add(polygon);
tool.FeatureClassToErase = polygon;
tool.ErasedFeatureClassName = "ErasedCities";
tool.Execute();
// Get the output of the tool.
var outputFeatureClass = tool.OutputItems[0] as DHI.Solutions.GISManager.Interfaces.IFeatureClass;
Export to KMZ/KML file¶
Tool for exporting a feature class to a KML file or a zipped KMZ file.
| Tool Info | Export to KMZ/KML file |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.KmlFileExport |
| API Reference | DHI.Solutions.GISManager.Tools.KMLFileExportTool.IKMLFileExportTool |
| Input Items | A single feature class |
| Output Items | No output items |
Tool Properties
- FilePath: Gets or sets file path of exported file. Specifying file extension .kmz, will zip the KML file generated.
- ExportMetadata: Gets or sets a value indicating whether the metadata of the entity should be exported.
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Export to KMZ/KML file") as DHI.Solutions.GISManager.Tools.KMLFileExportTool.KMLFileExportTool;
// Set the tool properties and execute.
var module = application.Modules.Get("GIS Manager") as DHI.Solutions.GISManager.Interfaces.IGISModule;
var featureClass = module.FeatureClassList.Fetch("/Sava/Lakes");
tool.InputItems.Add(featureClass);
tool.FilePath = @"c:\temp\lakes.kml";
tool.Execute();
Export to shape file¶
Tool for exporting a feature class into a shape file.
| Tool Info | Export to shape file |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.ShapeFileExport |
| API Reference | DHI.Solutions.GISManager.Tools.ShapeFileExportTool.IShapeFileExportTool |
| Input Items | A single feature class |
| Output Items | No output items |
Tool Properties
- FilePath: Gets or sets file path of exported file.
- ExportMetadata: Gets or sets a value indicating whether the metadata of the feature class should be exported.
- CoordinateSystem: Gets or sets the coordinate system of the shape file to export. By default, the source coordinate system if the input feature class will be used.
- CoordinateSystemName: Gets or sets the coordinate system name.
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Export to shape file") as DHI.Solutions.GISManager.Tools.ShapeFileExportTool.ShapeFileExportTool;
// Set the tool properties and execute.
var module = application.Modules.Get("GIS Manager") as DHI.Solutions.GISManager.Interfaces.IGISModule;
var featureClass = module.FeatureClassList.Fetch("/Sava/Lakes");
tool.InputItems.Add(featureClass);
tool.FilePath = @"c:\temp\lakes.shp";
tool.Execute();
Feature Class query¶
FeatureClassQueryTool class
| Tool Info | Feature Class query |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.FeatureClassQuery |
| API Reference | DHI.Solutions.GISManager.Tools.FeatureClassQueryTool.FeatureClassQueryTool |
| Input Items | No input items required |
| Output Items | No output items |
Tool Properties
The tool has no properties.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Feature Class query") as DHI.Solutions.GISManager.Tools.FeatureClassQueryTool.FeatureClassQueryTool;
# Get the tool.
tool = app.Tools.CreateNew("Feature Class query")
Flood Map InterpolationTool¶
The flood map interpolation tool will generate a new flood map from a library of pre-cooked flood maps and a set of gauge timeseries.
| Tool Info | Flood Map InterpolationTool |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.FloodMapInterpolation |
| API Reference | DHI.Solutions.GISManager.UI.Tools.FloodMapInterpolationTool.IFloodMapInterpolationTool |
| Input Items | No input items required |
| Output Items | A raster |
Tool Properties
- GaugeLocations: Gets or sets the path of the gauge feature class
- FloodMapLibrary: Gets or sets the path of a library of temporal rasters - one per gauge location. These libraries defines the zone of influences
- DEM: Gets or sets the DEM path that is used as template for the output flood map
- GaugeReadings: Gets or sets the gauge time series - one time series per gauge location
- TimePeriod: Gets or sets the value of a start and stop time for the interpolation and a time period frequency
- InterpolatedFloodMap: Gets or sets the path for the interpolation raster, which is stored in the database
- Script: Gets or sets the path of the script
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Flood Map Interpolation Tool") as DHI.Solutions.GISManager.UI.Tools.FloodMapInterpolationTool;
// Set the tool properties and execute.
tool.GaugeLocations = new GaugeLocation();
tool.GaugeLocations.FeatureClassPath = "/gauges";
IFeatureClass gaugeFeatureClass = _gisModule.FeatureClassList.Fetch(tool.GaugeLocations.FeatureClassPath);
List <IFeature> features = gaugeFeatureClass.FetchAll();
int index = 1;
foreach (var feature in features)
{
string gaugeName = "Gauge" + index.ToString();
tool.GaugeLocations.Locations.Add(feature.Id, gaugeName);
index++;
}
tool.FloodMapLibrary = new LocationsPath();
tool.FloodMapLibrary.Add("Gauge1","/floodLib_raster");
tool.GaugeReadings = new LocationsPath();
tool.GaugeReadings.Add("Gauge1","/TS1_one_timeSeries");
tool.DEM = "/dem";
tool.Script = "";
tool.TimePeriod.StartTime = new DateTime(2022,8,1,15,45,0);
tool.TimePeriod.StopTime = new DateTime(2022,8,1,16,45,0);
tool.TimePeriod.Period = 5;
tool.TimePeriod.PeriodType = EnumPeriod.Minutes;
tool.Execute();
Flood tool¶
FloodedAreaTool exports input feature to file
| Tool Info | Flood tool |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.FloodedArea |
| API Reference | DHI.Solutions.GISManager.Tools.FloodedAreaTool.IFloodedAreaTool |
| Input Items | A single feature class or a single features |
| Output Items | No output items |
Tool Properties
- FloodingFeatureClassName: Gets or sets the name of the feature class to be used as flooding
- Treshold: Gets or sets the treshold used for the flooding status
- ReturnFloodedOnly: Gets or sets a value indicating whether return only flooded features. true if [return flooded only]; otherwise, false.
- ReturnFlooding: Gets or sets a value indicating whether return flooding feature classs. true if [return flooding]; otherwise, false.
- MergedFloodFeatureName: Gets or sets the name of the merged flood feature.
The name of the merged flood feature. - FloodingAttribute: Gets or sets attibute name used for flooding - OutputAttributePrefix: Gets or sets output attribute prefix - ResultFeatureClassName: Gets or sets the name of the feature class where the results will be stored
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Flood tool") as DHI.Solutions.GISManager.Tools.FloodedAreaTool.IFloodedAreaTool;
# Get the tool.
tool = app.Tools.CreateNew("Flood tool")
# Get the tool.
tool = DHI.Solutions.GISManager.Tools.FloodedAreaTool.IFloodedAreaTool(app.Tools.CreateNew("Flood tool"))
Flow Direction¶
Tool for calculating the flow direction of a raster representing elevation values (DEM) based on the slope of steepest decent from any given cell. Output flow direction values are: 0 = None, 1 = East, 2 = Southest, 4 = South, 8 = Southwest, 16 = West, 32 = Northwest, 64 = North, 128 = Northeast, 256 = Local minimum, -512 = Undefined.
| Tool Info | Flow Direction |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.RasterProcessing |
| API Reference | DHI.Solutions.GISManager.Tools.RasterProcessing.IFlowDirectionTool |
| Input Items | One or more rasters |
| Output Items | A raster |
Tool Properties
The tool has no properties.
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Flow Direction") as DHI.Solutions.GISManager.Tools.RasterProcessing.FlowDirectionTool;
// Set the tool properties and execute.
tool.InputItems.Add(raster);
tool.Execute();
// Get the output of the tool.
var outRaster = tool.OutputItems[0] as DHI.Solutions.GISManager.Interfaces.IRaster;
Generic Raster Exporter¶
Generic tool for exporting a raster to a to a file. The tool is using GDAL raster drivers for exporting. Refer to GDAL raster driver documentation for more information https://gdal.org/drivers/raster/index.html.
| Tool Info | Generic Raster Exporter |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.GenericRasterExport |
| API Reference | DHI.Solutions.GISManager.Tools.GenericRasterExportTool.IGenericRasterExportTool |
| Input Items | A single raster |
| Output Items | No output items |
Tool Properties
- FilePath: Gets or sets file path of exported file.
- ExportMetadata: Gets or sets a value indicating whether the metadata of the entity should be exported.
- TimeSteps: Gets or sets the time step of the raster to export in the format "yyyy-MM-ddTHH:mm:ss". Required when exporting a time step from a temporal raster.
- RasterFormat: Gets or sets the format (raster driver) of the raster export. The following GDAL raster drivers are supported: GTiff (.tif), HFA (.img), ADRG (.gen), BT (.bt), EHdr (.bil), ENVI (.bin), ERS (.ers), ILWIS (.mpr), RRASTER (.grd), RMF (.rsw), CTable2 (.bin), IDA (.img), INGR (.cot), MFF (.hdr), PCIDSK (.ovr), SAGA (.SDAT), SGI (.rle), MFF2 (.HKV), Leveller (.ter), PCRaster (.map), RST (.rst), GTX (.gtx), MRF (.mrf), GSBG (.grd), GS7BG (.grd), JP2ECW (.jp2)
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Generic Raster Exporter") as DHI.Solutions.GISManager.Tools.GenericRasterExportTool.GenericRasterExportTool;
// Set the tool properties and execute.
var gisModule = application.Modules.Get(typeof(DHI.Solutions.GISManager.Interfaces.IGISModule)) as DHI.Solutions.GISManager.Interfaces.IGISModule;
var raster = gisModule.RasterList.Fetch("/Aladin/Aladin_4km");
tool.InputItems.Add(raster);
tool.FilePath = @"c:\temp\rasterexport";
tool.TimeSteps = "2012-11-04T13:00:00";
tool.RasterFormat = "GTiff";
tool.Execute();
Generic Raster Importer¶
The tool enables import of GDAL-supported raster formats. This tool supports the formats below: GTiff; HFA;ADRG; BT; EHdr; ENVI; ERS; HFA; ILWIS; RRASTER; RMF; CTable2; IDA; INGR;MFF; PCIDSK; SAGA; SGI; PCRaster; RST; GTX; MRF; GSBG; GS7BG;JP2ECW;ZIP;ASC.
| Tool Info | Generic Raster Importer |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.GenericRasterImporter |
| API Reference | DHI.Solutions.GISManager.Tools.GenericRasterImporterTool.IGenericRasterImporterTool |
| Input Items | A single raster group |
| Output Items | A raster |
Tool Properties
- RasterName: Gets or sets the full path of the Raster to create to store the imported raster. By default the raster is placed in the input raster group in input items. Specifying the rastpath will overwrite the location of the raster imported.
- FilePath: Gets or sets the file path of the file to import. The coordinate system will be read from the file when the file path property is changed.
- CoordinateSystemName: Gets or sets the coordinate system name of the file, in case the file does not contain coordinate system information.
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Generic Raster Importer") as DHI.Solutions.GISManager.Tools.GenericRasterImporterTool.GenericRasterImporterTool;
// Set the tool properties and execute.
var module = application.Modules.Get("GIS Manager") as DHI.Solutions.GISManager.Interfaces.IGISModule;
var featureClassGroup = module.RasterGroupList.Fetch("/Aladin");
tool.InputItems.Add(featureClassGroup);
tool.FilePath = @"c:\temp\gdal_20121104160000.tif";
// Place the raster in another path than the in the raster group in input items.
tool.RasterName = "/Aladin54/MyGdalRaster";
tool.Execute();
// Get the output of the tool.
var raster = tool.OutputItems[0] as DHI.Solutions.GISManager.Interfaces.IRaster:
Generic Vector Exporter¶
This tool exports a feature class to a GDAL file. Metadata for feature class is also written in case ExportMetadata is true. The tool supports the following formats: ESRI Shapefile; KML; GPX; GeoJSON; XLSX; CSV; PDF; BNA; DGN; Geoconcept; GMT; MapInfo File; GPSTrackMaker;PGDUMP.
| Tool Info | Generic Vector Exporter |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.GenericVectorExport |
| API Reference | DHI.Solutions.GISManager.Tools.GenericVectorExportTool.IGenericVectorExportTool |
| Input Items | A single feature class |
| Output Items | No output items |
Tool Properties
- FilePath: Gets or sets file path of exported file.
- VectorFormat: Gets or sets the vector format to use to get the GDAL vector driver from.
- ExportMetadata: Gets or sets a value indicating whether the metadata of the entity should be exported.
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Generic Vector Exporter") as DHI.Solutions.GISManager.Tools.GenericVectorExportTool.GenericVectorExportTool;
// Set the tool properties and execute.
var module = application.Modules.Get("GIS Manager") as DHI.Solutions.GISManager.Interfaces.IGISModule;
var featureClass = module.FeatureClassList.Fetch("/Sava/Rivers");
tool.InputItems.Add(featureClass);
tool.VectorFormat = "KML";
tool.FilePath = @"C:\temp\Rivers5.kml";
tool.Execute();
Generic Vector Importer¶
This tool enables import of GDAL-supported vector formats. The tool supports the following formats: ESRI Shapefile; KML; KMZ; GPX; GeoJSON; PDF; DGN; GMT; MapInfoFile; GPSTrackMaker; ZIP; DXF.
| Tool Info | Generic Vector Importer |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.GenericVectorImporter |
| API Reference | DHI.Solutions.GISManager.Tools.GenericVectorImporterTool.IGenericVectorImporterTool |
| Input Items | A single feature class group |
| Output Items | A feature class |
Tool Properties
- FeatureClassName: Gets or sets the name of the Feature Class to create to store the imported feature class.
- FilePath: Gets or sets the input file path to import.
- CoordinateSystem: Gets or sets the coordinate system of the data to be imported, in case the coordinate system cannot be detected from the file.
- CoordinateSystemName: Gets or sets the coordinate system name.
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Generic Vector Importer") as DHI.Solutions.GISManager.Tools.GenericVectorImporterTool.GenericVectorImporterTool;
// Set the tool properties and execute.
var module = application.Modules.Get("GIS Manager") as DHI.Solutions.GISManager.Interfaces.IGISModule;
var featureClassGroup = module.FeatureClassGroupList.Fetch("/Sava");
tool.InputItems.Add(featureClassGroup);
tool.FilePath = @"C:\temp\Rivers.kml";
tool.FeatureClassName = "/Sava/Rivers1";
tool.Execute();
// Get the output of the tool.
var featureClass = tool.OutputItems[0] as DHI.Solutions.GISManager.Interfaces.IFeatureClass;
Import from ASCII file¶
This tool imports point features from a comma separated ASCII file or from a folder which contains ASCII files (.csv or .txt). First row should contain column headers. The column header row should contain column names X and Y, but does also support columns for feature attributes. Feature X and Y values should be in the specified coordinate system.
| Tool Info | Import from ASCII file |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.ASCIIFileImport |
| API Reference | DHI.Solutions.GISManager.UI.Tools.ASCIIFileImportTool.IASCIIFileImportTool |
| Input Items | A single feature class group |
| Output Items | A feature class |
Tool Properties
- CoordinateSystem: Gets or sets the coordinate system of the ASCII file to import
- CoordinateSystemName: Gets or sets the coordinate system name of the ASCII file to import.
- FeatureClassName: Gets or sets the name of the feature class to create to store the imported ASCII file
- Group: Gets or sets the full group path holding the feature classes to where the file will be imported
- FilePath: Gets or sets the file path fo the ASCII file to import. Enabled when ImportFromOption = SingleFile.
- Folder: Gets or sets the Folder from which the file will be imported from. Enabled when ImportFromOption = Folder.
- SaveToDatabase: Gets or sets a value indicating whether to save the feature class to the database.
- ImportFromOption: Gets or sets the import option. The import option determines if a single file, or all files in a specified folder shall be imported.
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Import from ASCII file") as DHI.Solutions.GISManager.UI.Tools.ASCIIFileImportTool.ASCIIFileImportTool;
// Set the tool properties and execute.
var gisModule = application.Modules.Get("GIS Manager") as DHI.Solutions.GISManager.Interfaces.IGISModule;
tool.ImportFromOption = DHI.Solutions.GISManager.Tools.ImportTypeOption.SingleFile;
tool.FilePath = @"c:\temp\file1.csv";
tool.FeatureClassName = "/Group/ASCIItst";
tool.CoordinateSystem = gisModule.DefaultCoordinateSystem;
tool.Execute();
Import from ASCII grid file¶
The Import from ASCII grid file tool imports an ESRI ASCII file into a raster.
| Tool Info | Import from ASCII grid file |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.ASCIIGridFileImport |
| API Reference | DHI.Solutions.GISManager.UI.Tools.ASCIIGridImportTool.IASCIIGridImportTool |
| Input Items | A single raster group |
| Output Items | No output items |
Tool Properties
- CoordinateSystem: Gets or sets the coordinate system of the ASCII grid file to import
- CoordinateSystemName: Gets or sets the coordinate system name of the ASCII grid file to import.
- RasterName: Gets or sets the name of the Raster to create to store the imported ASCII file
- FilePath: Gets or sets the file path fo the ASCII Grid file to import
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Import from ASCII grid file") as DHI.Solutions.GISManager.UI.Tools.ASCIIGridImportTool.ASCIIGridImportTool;
// Set the tool properties and execute.
var gisModule = application.Modules.Get("GIS Manager") as DHI.Solutions.GISManager.Interfaces.IGISModule;
tool.FilePath = @"c:\temp\small_grid.asc";
tool.RasterName = "/Group/ASCIItst";
// Set the coordinate system of the ESRI ASCII file to import (here the default coordinate system of the GIS module is used).
tool.CoordinateSystem = gisModule.DefaultCoordinateSystem;
tool.Execute();
Import from Dfs2 file¶
Tool for importing Dfs2 files.
| Tool Info | Import from Dfs2 file |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.Dfs2Import |
| API Reference | DHI.Solutions.GISManager.UI.Tools.Dfs2ImportTool.IDfs2ImportTool |
| Input Items | A single raster group |
| Output Items | A raster |
Tool Properties
- CoordinateSystem: Gets or sets the coordinate system of the Dfs2 file to import
- CoordinateSystemName: Gets or sets the coordinate system name of the Dfs2 file to import.
- RasterGroupName: Gets or sets the name of the Raster Group to create to store rasters imported Dfs2 file
- FilePath: Gets or sets the file path fo the Dfs2 file to import
- AdditionalItems: Gets or sets a value indicating whether additional items will be computed during DFS2 loading.
- RasterItem: Gets or sets the raster item to import.
- FileCoordinateSystem: Gets or sets the coordinate system.
- FileTypes: Gets the value for supported file types. Supported file types correspond to the extension (without .) of supported file types and separated by ; in case more than one file type is supported
Tool Methods
- FillChangeLog(System.String fileName ,System.Int32 position ,System.String logName ,DHI.Solutions.Generic.IEntity entity ,DHI.Solutions.Generic.IChangeLogModule changeLogModule): Fills the change log.
- FillRasterBand(DHI.Solutions.GISManager.Interfaces.IRasterBand rasterBand ,System.String fileName ,System.Int32 position ,System.Boolean keepOpened): Fills the raster band.
- CloseFile(System.String fileName): Closes the file.
- GetRastersList(System.String fileName): Gets the rasters list.
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Import from Dfs2 file") as DHI.Solutions.GISManager.UI.Tools.Dfs2ImportTool.Dfs2ImportTool;
// Set the tool properties and execute.
var module = application.Modules.Get("GIS Manager") as DHI.Solutions.GISManager.Interfaces.IGISModule;
var rasterGroup = module.RasterGroupList.Fetch("/MyRasterGroup");
// Set input items before specifying the file name in order to read the coordinate system from the file.
tool.InputItems.Add(rasterGroup);
tool.FilePath = @"c:\temp\raster.dfs2";
tool.Execute();
// Get the output of the tool.
var rasterOutput = tool.OutputItems[0] as DHI.Solutions.GISManager.Interfaces.IRaster;
Import from Dfs3 file¶
This tool imports data from Dfs3.
| Tool Info | Import from Dfs3 file |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.Dfs3Import |
| API Reference | DHI.Solutions.GISManager.UI.Tools.Dfs3ImportTool.IDfs3ImportTool |
| Input Items | A single raster group |
| Output Items | A raster |
Tool Properties
- CoordinateSystem: Gets or sets the coordinate system of the Dfs3 file to import
- CoordinateSystemName: Gets or sets the coordinate system name of the Dfs3 file to import.
- RasterGroupName: Gets or sets the name of the Raster Group to create to store rasters imported Dfs3 file
- FilePath: Gets or sets the file path fo the Dfs3 file to import
- AdditionalItems: Gets or sets a value indicating whether additional items will be computed during DFS3 loading.
- LayerNumbers: Gets or sets the value of LayerNumbers
- RasterItem: Gets or sets the raster item to import.
- FileCoordinateSystem: Gets or sets the coordinate system.
- FileTypes: Gets the value for supported file types. Supported file types correspond to the extension (without .) of supported file types and separated by ; in case more than one file type is supported
Tool Methods
- FillChangeLog(System.String fileName ,System.Int32 position ,System.String logName ,DHI.Solutions.Generic.IEntity entity ,DHI.Solutions.Generic.IChangeLogModule changeLogModule): Fills the change log.
- FillRasterBand(DHI.Solutions.GISManager.Interfaces.IRasterBand rasterBand ,System.String fileName ,System.Int32 position ,System.Boolean keepOpened): Fills the raster band.
- CloseFile(System.String fileName): Closes the file.
- GetRastersList(System.String fileName): Gets the rasters list.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Import from Dfs3 file") as DHI.Solutions.GISManager.UI.Tools.Dfs3ImportTool.IDfs3ImportTool;
# Get the tool.
tool = app.Tools.CreateNew("Import from Dfs3 file")
# Get the tool.
tool = DHI.Solutions.GISManager.UI.Tools.Dfs3ImportTool.IDfs3ImportTool(app.Tools.CreateNew("Import from Dfs3 file"))
Import from Dfsu file¶
This tool imports data from Dfsu.
| Tool Info | Import from Dfsu file |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.DfsuImport |
| API Reference | DHI.Solutions.GISManager.UI.Tools.DfsuImportTool.IDfsuImportTool |
| Input Items | No input items required |
| Output Items | No output items |
Tool Properties
- CoordinateSystem: Gets or sets the coordinate system of the Dfsu file to import
- CoordinateSystemName: Gets or sets the coordinate system name of the Dfsu file to import.
- MeshName: Gets or sets the name of the mesh.
- FilePath: Gets or sets the file path fo the Dfsu file to import
- TimeBlockSize: Gets or sets the size of the time block.
- SpaceBlockSize: Gets or sets the size of the space block.
- TimeStepsCount: Gets the time steps count.
- ElementsCount: Gets the elements count.
- TimeSpaceRatio: Gets or sets the time / space blok side ratio.
- TimeBlocksCount: Gets the time blocks count.
- SpaceBlocksCount: Gets the space blocks count.
Tool Methods
- SetOptimalBlockSize(System.Int32 numTimeSteps ,System.Int32 numElements ,System.Double timeSpaceRatio): Sets the size of the optimal block.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Import from Dfsu file") as DHI.Solutions.GISManager.UI.Tools.DfsuImportTool.IDfsuImportTool;
# Get the tool.
tool = app.Tools.CreateNew("Import from Dfsu file")
# Get the tool.
tool = DHI.Solutions.GISManager.UI.Tools.DfsuImportTool.IDfsuImportTool(app.Tools.CreateNew("Import from Dfsu file"))
Import from Dfsu file to feature class¶
This tool imports data from Dfsu to feature class.
| Tool Info | Import from Dfsu file to feature class |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.DfsuToFeaturesImport |
| API Reference | DHI.Solutions.GISManager.UI.Tools.DfsuToFeaturesImportTool.IDfsuFcImportTool |
| Input Items | A single feature class group |
| Output Items | No output items |
Tool Properties
- CoordinateSystem: Gets or sets the coordinate system of the Dfsu file to import
- FeatureClassName: Gets or sets the name of the feature class to create to store the imported shape file
- FilePath: Gets or sets the file path fo the Dfsu file to import
- TimeStepsCount: Gets the time steps count.
- SelectionVariable: Gets or sets the selection variable.
- TimeInterval: Gets or sets the time interval for read in case of Temporal feature class.
The time interval in num of steps.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Import from Dfsu file to feature class") as DHI.Solutions.GISManager.UI.Tools.DfsuToFeaturesImportTool.IDfsuFcImportTool;
# Get the tool.
tool = app.Tools.CreateNew("Import from Dfsu file to feature class")
# Get the tool.
tool = DHI.Solutions.GISManager.UI.Tools.DfsuToFeaturesImportTool.IDfsuFcImportTool(app.Tools.CreateNew("Import from Dfsu file to feature class"))
Import from Image file¶
This tool imports rasters stored in an image file.
| Tool Info | Import from Image file |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.ImageFileImport |
| API Reference | DHI.Solutions.GISManager.UI.Tools.ImageFileImportTool.IImageFileImportTool |
| Input Items | A single raster group |
| Output Items | No output items |
Tool Properties
- RasterName: Gets or sets the name of the Raster to create to store the imported Image file
- FilePath: Gets or sets the file path of the Image file to import
- ScaleImageWhenZooming: Gets or sets a value indicating whether image shall be scaled or not.
- UpperLeftX: Gets or sets the X coordinate of upper Left corner
If is true, this represents the longitude value of the upper left corner in decimal degrees (WGS 84) If is false, this represents the horizontal offset in pixels from the upper left corner of the map - UpperLeftY: Gets or sets the Y coordinate of upper Left corner
If is true, this represents the latitude value of the upper left corner in decimal degrees (WGS 84) If is false, this represents the vertical offset in pixels from the upper left corner of the map
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Import from Image file") as DHI.Solutions.GISManager.UI.Tools.ImageFileImportTool.IImageFileImportTool;
# Get the tool.
tool = app.Tools.CreateNew("Import from Image file")
# Get the tool.
tool = DHI.Solutions.GISManager.UI.Tools.ImageFileImportTool.IImageFileImportTool(app.Tools.CreateNew("Import from Image file"))
Import from IMG file¶
Tool for importing Erdas Imagine (.img) files as raters into the MIKE OPERATIONS database.
| Tool Info | Import from IMG file |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.ImgRasterImport |
| API Reference | DHI.Solutions.GISManager.UI.Tools.IMGRasterImportTool.IIMGRasterImportTool |
| Input Items | A single raster group |
| Output Items | No output items |
Tool Properties
- CoordinateSystem: Gets or sets the coordinate system of the IMG file to import
- CoordinateSystemName: Gets or sets the coordinate system name of the IMG file to import.
- RasterName: Gets or sets the name of the Raster to create to store the imported IMG file
- FilePath: Gets or sets the file path fo the Erdas Imagine (.img) file to import.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Import from IMG file") as DHI.Solutions.GISManager.UI.Tools.IMGRasterImportTool.IIMGRasterImportTool;
# Get the tool.
tool = app.Tools.CreateNew("Import from IMG file")
# Get the tool.
tool = DHI.Solutions.GISManager.UI.Tools.IMGRasterImportTool.IIMGRasterImportTool(app.Tools.CreateNew("Import from IMG file"))
Import from KML/KMZ file¶
This tool imports features from a KML/KMZ file or from a folder which contains KML/KMZ files.
| Tool Info | Import from KML/KMZ file |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.KmlFileImport |
| API Reference | DHI.Solutions.GISManager.UI.Tools.KMLFileImportTool.IKMLFileImportTool |
| Input Items | A single feature class group |
| Output Items | No output items |
Tool Properties
- FeatureClassName: Gets or sets the name of the feature class to create to store the imported KML file
- Group: Gets or sets the full group path holding the feature classes to where the file will be imported
- FilePath: Gets or sets the file path fo the KML file to import. Enabled when ImportFromOption = SingleFile.
- Folder: Gets or sets the Folder from which the file will be imported from. Enabled when ImportFromOption = Folder.
- ImportFromOption: Gets or sets the import option. The import option determines if a single file, or all files in a specified folder shall be imported.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Import from KML/KMZ file") as DHI.Solutions.GISManager.UI.Tools.KMLFileImportTool.IKMLFileImportTool;
# Get the tool.
tool = app.Tools.CreateNew("Import from KML/KMZ file")
# Get the tool.
tool = DHI.Solutions.GISManager.UI.Tools.KMLFileImportTool.IKMLFileImportTool(app.Tools.CreateNew("Import from KML/KMZ file"))
Import from NetCDF file¶
This tool imports a raster from a netCDF file.
| Tool Info | Import from NetCDF file |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.NetCdfImport |
| API Reference | DHI.Solutions.GISManager.UI.Tools.NetCDFImportTool.INetCDFImportTool |
| Input Items | A single raster group |
| Output Items | No output items |
Tool Properties
- CoordinateSystem: Gets or sets the coordinate system of the NetCDF file to import.
- CoordinateSystemName: Gets or sets the coordinate system name of the NetCDF file to import.
- RasterGroupName: Gets or sets the name of the Raster Group to create to store the imported NetCDF file
- FilePath: Gets or sets the file path for the NetCDF file to import
- NetCDFEngine: Gets or sets the NetCDF engine to use (DHI or IKVM_OpenJDK)
- Configuration: Gets or sets the configuration for engine type IKVM_OpenJDK.
- OutputDfs2: Gets or sets the output dfs2 for engine type IKVM_OpenJDK.
- FileCoordinateSystem: Gets or sets the coordinate system.
- FileTypes: Gets the value for supported file types. Supported file types correspond to the extension (without .) of supported file types and separated by ; in case more than one file type is supported
Tool Methods
- FillChangeLog(System.String fileName ,System.Int32 position ,System.String logName ,DHI.Solutions.Generic.IEntity entity ,DHI.Solutions.Generic.IChangeLogModule changeLogModule): Fills the change log.
- FillRasterBand(DHI.Solutions.GISManager.Interfaces.IRasterBand rasterBand ,System.String fileName ,System.Int32 position ,System.Boolean keepOpened): Fills the raster band.
- CloseFile(System.String fileName): Closes the file.
- GetRastersList(System.String fileName): Gets the rasters list.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Import from NetCDF file") as DHI.Solutions.GISManager.UI.Tools.NetCDFImportTool.INetCDFImportTool;
# Get the tool.
tool = app.Tools.CreateNew("Import from NetCDF file")
# Get the tool.
tool = DHI.Solutions.GISManager.UI.Tools.NetCDFImportTool.INetCDFImportTool(app.Tools.CreateNew("Import from NetCDF file"))
Import from NetCDF file (Advanced)¶
This tool imports raster from a NetCDF file.
| Tool Info | Import from NetCDF file (Advanced) |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.NetCdfImport |
| API Reference | DHI.Solutions.GISManager.UI.Tools.NetCDFImportTool.IFlexibleNetCDFImportTool |
| Input Items | A single raster group |
| Output Items | No output items |
Tool Properties
- RasterGroupName: Gets or sets the name of the Raster Group to create to store the imported NetCDF file.
- RasterName: Gets or sets the name of the output raster. If left blank, this will be set to be equal to the variable name plus the NetCDF unit, if available.
- FilePath: Gets or sets the file path for the NetCDF file to import.
- Variable: Gets or sets the variable name to be imported from the NetCDF file.
- CoordinateSystem: Gets or sets the coordinate system of the NetCDF file to import.
- CoordinateSystemName: Gets or sets the coordinate system name of the NetCDF file to import.
- CellWidth: Gets or sets the cell width to apply for the raster. (Defaults to average width between X points in NetCDF file.)
- CellHeight: Gets or sets the cell height to apply for the raster. (Defaults to average height between Y points in NetCDF file.)
- ScaleX: Gets or sets the scale factor for the X coordinates. (Coordinates will be multiplied by this factor.)
- ScaleY: Gets or sets the scale factor for the Y coordinates. (Coordinates will be multiplied by this factor.)
- BaseTime: Gets or sets the base time for the time dimension. Most time dimensions are of units "XX hours since DDTT" where DDTT is a parsable DateTime. This property allows you to override this base time. It is not necessarily the same as the first time step.
- StartTime: Gets the start time calculated for the current variable's time dimension, the base time, and time offset.
- TimeOffset: Gets or sets a time offset in hours used to adjust the time of each time step. This can be used to adjust for time zone differences, for example.
- EumItem: Gets or sets the MIKE Zero EUM Item (unit type) code.
- EumUnit: Gets or sets the MIKE Zero EUM Unit code.
- ExistingRasterOption: Gets or sets The behavior for overwriting when an existing raster is specified. This property is ignored when no raster exists at the specified location.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Import from NetCDF file (Advanced)") as DHI.Solutions.GISManager.UI.Tools.NetCDFImportTool.IFlexibleNetCDFImportTool;
# Get the tool.
tool = app.Tools.CreateNew("Import from NetCDF file (Advanced)")
# Get the tool.
tool = DHI.Solutions.GISManager.UI.Tools.NetCDFImportTool.IFlexibleNetCDFImportTool(app.Tools.CreateNew("Import from NetCDF file (Advanced)"))
Import from Res11 file¶
This tool imports res11 data. It imports the network as GIS data and the time series data as time series associated to the GIS features.Res11 files can only be imported if the projection is already defined in the DSS. Otherwise, add the projection mapping to ESRIProjections.txt file in the application folder.
| Tool Info | Import from Res11 file |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.Res11Import |
| API Reference | DHI.Solutions.GISManager.UI.Tools.Res11ImportTool.IRes11ImportTool |
| Input Items | A single feature class group |
| Output Items | No output items |
Tool Properties
- CoordinateSystem: Gets or sets the coordinate system of the res11 data to import
- CoordinateSystemName: Gets or sets the coordinate system name of the res11 data to import.
- Group: Gets or sets the full group path holding the feature classes to where the network will be imported
- FilePath: Gets or sets the file path for the res11 file to import. Enabled when ImportFromOption = SingleFile.
- Folder: Gets or sets the Folder from which the file will be imported from. Enabled when ImportFromOption = Folder.
- ImportFromOption: Gets or sets the import option. The import option determines if a single file, or all files in a specified folder shall be imported.
- TimeSeriesGroup: Gets or sets the group where time series will be imported to
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Import from Res11 file") as DHI.Solutions.GISManager.UI.Tools.Res11ImportTool.IRes11ImportTool;
# Get the tool.
tool = app.Tools.CreateNew("Import from Res11 file")
# Get the tool.
tool = DHI.Solutions.GISManager.UI.Tools.Res11ImportTool.IRes11ImportTool(app.Tools.CreateNew("Import from Res11 file"))
Import from shape file¶
This tool imports features from one or more shape file(s) stored on the file system and creates a feature class in the database.
| Tool Info | Import from shape file |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.ShapeFileImport |
| API Reference | DHI.Solutions.GISManager.UI.Tools.ShapeFileImportTool.IShapeFileImportTool |
| Input Items | A single feature class group |
| Output Items | No output items |
Tool Properties
- IsOneFeatureClass: Gets a value indicating whether this instance create one feature class. true if this instance create one feature class; otherwise, false.
- ImportTemporal: Gets or sets a value indicating whether [import into temporal feature class]. true if [import into temporal feature class]; otherwise, false.
- CoordinateSystem: Gets or sets the coordinate system of the shape file to import
- CoordinateSystemName: Gets or sets the coordinate system name of the shape file to import.
- Group: Gets or sets the full group path holding the feature classes to where the file will be imported
- FeatureClassName: Gets or sets the name of the feature class to create to store the imported shape file
- FilePath: Gets or sets the file path of the shape file to import. Enabled when ImportFromOption = SingleFile.
- Folder: Gets or sets the Folder from which the file will be imported from. Enabled when ImportFromOption = Folder.
- ImportFromOption: Gets or sets the import option. The import option determines if a single file, or all files in a specified folder shall be imported.
- DirectoryPath: Gets or sets the directory path of the Shp files (*.shp) to import.
- AddToExistingFeatureClass: Gets or sets a value indicating whether add to existing raster.
- DateTimeFilenameMask: Gets or sets the date time filename mask.
- CodePageValue: Gets or sets the code page value to use. Default is codepage 1252.
- SaveToDatabase: Gets or sets a value indicating whether to save the feature class to the database.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Import from shape file") as DHI.Solutions.GISManager.UI.Tools.ShapeFileImportTool.IShapeFileImportTool;
# Get the tool.
tool = app.Tools.CreateNew("Import from shape file")
# Get the tool.
tool = DHI.Solutions.GISManager.UI.Tools.ShapeFileImportTool.IShapeFileImportTool(app.Tools.CreateNew("Import from shape file"))
Import from TIFF file¶
This tool imports raster from a TIFF file.
| Tool Info | Import from TIFF file |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.TiffImport |
| API Reference | DHI.Solutions.GISManager.UI.Tools.TIFFRasterImportTool.ITIFFRasterImportTool |
| Input Items | A single raster group |
| Output Items | No output items |
Tool Properties
- CoordinateSystem: Gets or sets the coordinate system of the TIFF file to import
- CoordinateSystemName: Gets or sets the coordinate system name of the TIFF file to import.
- RasterName: Gets or sets the name of the Raster to create to store the imported TIFF file
- FilePath: Gets or sets the file path fo the TIFF file to import
- WorldFile: Gets or sets the file path fo the TIFF world file
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Import from TIFF file") as DHI.Solutions.GISManager.UI.Tools.TIFFRasterImportTool.ITIFFRasterImportTool;
# Get the tool.
tool = app.Tools.CreateNew("Import from TIFF file")
# Get the tool.
tool = DHI.Solutions.GISManager.UI.Tools.TIFFRasterImportTool.ITIFFRasterImportTool(app.Tools.CreateNew("Import from TIFF file"))
Import temporal rasters from TIFF files¶
This class imports data from TIFF.
| Tool Info | Import temporal rasters from TIFF files |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.TiffTemporalImport |
| API Reference | DHI.Solutions.GISManager.UI.Tools.TIFFTemporalImportTool.ITIFFTemporalImportTool |
| Input Items | A single raster group |
| Output Items | No output items |
Tool Properties
- CoordinateSystem: Gets or sets the coordinate system of the TIFF file to import
- CoordinateSystemName: Gets or sets the coordinate system name of the TIFF file to import.
- RasterName: Gets or sets the name of the Raster to create to store rasters imported from TIFF files
- DirectoryPath: Gets or sets the directory path fof the TIFF file to import
- WorldFile: Gets or sets the file path fo the TIFF world file
- AddToExistingRaster: Gets or sets a value indicating whether add to existing raster.
- DateTimeFilenameMask: Gets or sets the date time filename mask.
- Enum_Item: Gets or sets the enum item.
- Enum_Unit: Gets or sets the enum unit.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Import temporal rasters from TIFF files") as DHI.Solutions.GISManager.UI.Tools.TIFFTemporalImportTool.ITIFFTemporalImportTool;
# Get the tool.
tool = app.Tools.CreateNew("Import temporal rasters from TIFF files")
# Get the tool.
tool = DHI.Solutions.GISManager.UI.Tools.TIFFTemporalImportTool.ITIFFTemporalImportTool(app.Tools.CreateNew("Import temporal rasters from TIFF files"))
Intersect Feature Classes¶
The intersect tool creates a geometric intersection of two input polygon feature classes. Only the features, or portions of features, which overlap in all input feature classes will be written to the output feature class. Attributes from all input features are mapped to all output features.
| Tool Info | Intersect Feature Classes |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.GeoProcessing |
| API Reference | DHI.Solutions.GISManager.Tools.GeoProcessing.IIntersectTool |
| Input Items | Two feature classes |
| Output Items | A feature class |
Tool Properties
- GISProcessor: Gets or sets the GIS processor to use when executing the tool
- IntersectFeatureClassName: Gets or sets the Name of new Intersection Feature Class.
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Intersect Feature Classes") as DHI.Solutions.GISManager.Tools.GeoProcessing.IntersectTool;
// Set the tool properties and execute.
var cities = _gisModule.DefaultGISDataProvider.FeatureClassList.Fetch("/Cities");
var polygon = _gisModule.DefaultGISDataProvider.FeatureClassList.Fetch("/1Polygon");
tool.InputItems.Add(cities);
tool.InputItems.Add(polygon);
tool.IntersectFeatureClassName= "IntersectedFeatureClass";
tool.Execute();
// Get the output of the tool.
var outputFeatureClass = tool.OutputItems[0] as DHI.Solutions.GISManager.Interfaces.IFeatureClass;
Inverse Distance Weighted Interpolation¶
A tool for nearest inverse-distance weighted interpolation.
| Tool Info | Inverse Distance Weighted Interpolation |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.RasterInterpolation |
| API Reference | DHI.Solutions.GISManager.Tools.RasterInterpolation.IIDWInterpolationTool |
| Input Items | A single features or a single feature class |
| Output Items | A raster |
Tool Properties
- Attribute: Gets or sets the attribute to get values for the points to use in the interpolation
- RasterDefinition: Gets or sets the definition for the output raster Coordinate system is not used. Instead, coordinate system for input feature class is used
- ExtrapolateValues: Gets or sets a value indicating whether interpolated values are used even in case where they are bigger than maximum input value or smaller than minimum input value. Otherwise maximum and minimum values are used respectively.
- AutoScale: Gets or sets a value indicating whether the tool should automatically calculate scale when changing height and width, or height and width when changing scale. When AutoScale is true, the tool will keep the overall extent of the output raster the same as the input feature class within the precision of the scale factor in each dimension.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Inverse Distance Weighted Interpolation") as DHI.Solutions.GISManager.Tools.RasterInterpolation.IIDWInterpolationTool;
# Get the tool.
tool = app.Tools.CreateNew("Inverse Distance Weighted Interpolation")
# Get the tool.
tool = DHI.Solutions.GISManager.Tools.RasterInterpolation.IIDWInterpolationTool(app.Tools.CreateNew("Inverse Distance Weighted Interpolation"))
Kriging Interpolation¶
This tool interpolates point data producing a raster with values given by the specified attribute of the input point feature class using the kriging algorithm which assigns to every grid cell a value calculated using the simple kriging method with specified covariance method. The interpolated values are computed using linear regression of input values.
| Tool Info | Kriging Interpolation |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.RasterInterpolation |
| API Reference | DHI.Solutions.GISManager.Tools.RasterInterpolation.IKrigingInterpolationTool |
| Input Items | A single features or a single feature class |
| Output Items | A raster |
Tool Properties
- Attribute: Gets or sets the attribute to get values for the points to use in the interpolation
- CovarianceType: Gets or sets the to use to compute covariance of the values in two points using the scaled distance between points
- MissingValue: Gets or sets the missing value when the distance to the closest point is bigger than radius
- RelativeScalingFactor: Gets or sets the scaling factor to normalize point distances (typically 1)
- RasterDefinition: Gets or sets the definition for the output raster
- ExtrapolateValues: Gets or sets a value indicating whether interpolated values are used even in case where they are bigger than maximum input value or smaller than minimum input value. Otherwise maximum and minimum values are used respectively.
- AutoScale: Gets or sets a value indicating whether the tool should automatically calculate scale when changing height and width, or height and width when changing scale. When AutoScale is true, the tool will keep the overall extent of the output raster the same as the input feature class within the precision of the scale factor in each dimension.
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Kriging Interpolation") as DHI.Solutions.GISManager.Tools.RasterInterpolation.KrigingInterpolationTool;
// Set the tool properties and execute.
tool.InputItems.Add(featureClass);
tool.Execute();
// Get the output of the tool.
var output = tool.OutputItems[0] as DHI.Solutions.GISManager.Interfaces.IRaster;
Measure¶
Tool for adding the attributes “area” and “perimeter” to a polygon feature class or attribute “length” to a line feature class.
| Tool Info | Measure |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.GeoProcessing |
| API Reference | DHI.Solutions.GISManager.Tools.GeoProcessing.IMeasureTool |
| Input Items | One or more feature classes |
| Output Items | A feature class |
Tool Properties
- Unit: Gets or sets the unit for the measures
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Measure") as DHI.Solutions.GISManager.Tools.GeoProcessing.MeasureTool;
// Set the tool properties and execute.
tool.InputItems.Add(featureClass);
tool.Unit = DHI.Solutions.GISManager.Interfaces.DisplayUnit.Kilometer;
tool.Execute();
// Get the output of the tool.
var outputFeatureClass = tool.OutputItems[0] as DHI.Solutions.GISManager.Interfaces.IFeatureClass;
Merge Feature Classes¶
Merge tool. This tool takes 2 feature classes and generates a 3rd feature class with merged geometries.
| Tool Info | Merge Feature Classes |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.GeoProcessing |
| API Reference | DHI.Solutions.GISManager.Tools.GeoProcessing.IMergeTool |
| Input Items | Two feature classes |
| Output Items | A feature class |
Tool Properties
- GISProcessor: Gets or sets the GIS processor to use when executing the tool
- MergeFeatureClassName: Gets or sets name of the new merged feature class
- MasterFeatureClass: Gets or sets the feature class to act as master feature class. Master feature class is the feature class whose attribute will be used for merging
- AttributesMapping: Gets the dictionary of mapping between attributes in master feature class and attribute in feature class to merge
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Merge Feature Classes") as DHI.Solutions.GISManager.Tools.GeoProcessing.MergeTool;
// Set the tool properties and execute.
tool.InputItems.Add(featureClass1);
tool.InputItems.Add(featureClass2);
tool.MergeFeatureClassName = "MergeFeatureClassName";
tool.MasterFeatureClass = featureClass1;
tool.AttributesMapping.Clear();
tool.AttributesMapping.Add("Attrib1", "Attrib1");
tool.AttributesMapping.Add("Attrib2", "Attrib2");
tool.AttributesMapping.Add("Attrib3", "Attrib3");
tool.Execute();
// Get the output of the tool.
var outputFeatureClass = tool.OutputItems[0] as DHI.Solutions.GISManager.Interfaces.IFeatureClass;
MIKECloudDfsUploadTool¶
Tool to upload the dfs2 file to MIKE Cloud
| Tool Info | MIKECloudDfsUploadTool |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.MikeCloudDfsUpload |
| API Reference | DHI.Solutions.GISManager.Tools.MikeCloudSpatialUploadTool.IMikeCloudSpatialUploadTool |
| Input Items | No input items required |
| Output Items | No output items |
Tool Properties
- FilePath: Gets or sets the file or folder path containing dfs files to be uploaded to the MIKE Cloud Platform.
- FileType: Gets or sets the dfs file type to upload.
- DestinationRootPath: Gets or sets the path in the MIKE Cloud Platform project to upload time series and time series groups to.
- Overwrite: Gets or sets a value indicating whether existing time series should be overwritten. If False, existing time series will be skipped.
- MIKECloudProvider: Gets or sets the MIKE Cloud Raster provider to be used for uploading dfs2 and dfsu files.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("MIKECloudDfsUploadTool") as DHI.Solutions.GISManager.Tools.MikeCloudSpatialUploadTool.IMikeCloudSpatialUploadTool;
# Get the tool.
tool = app.Tools.CreateNew("MIKECloudDfsUploadTool")
# Get the tool.
tool = DHI.Solutions.GISManager.Tools.MikeCloudSpatialUploadTool.IMikeCloudSpatialUploadTool(app.Tools.CreateNew("MIKECloudDfsUploadTool"))
MikeCloudSharedDataDownloadTool¶
The Mike Cloud Shared Data Download tool download data into a feature class.
| Tool Info | MikeCloudSharedDataDownloadTool |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.MikeCloudSharedData |
| API Reference | DHI.Solutions.GISManager.Tools.MikeCloudSharedDataTool.IMikeCloudSharedDataDownloadTool |
| Input Items | A single feature class |
| Output Items | No output items |
Tool Properties
- GISProcessor: Gets or sets the GIS processor to use when executing the tool
- Dataset: Gets or sets the dataset.
- From: Gets or sets the datetime from.
- To: Gets or sets the datetime to.
- OutputName: Gets or sets the output name.
- OutputType: Gets or sets the output type.
- OutputLocation: Gets or sets the output location.
- OutputDiskFolder: Gets or sets the output path.
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("MikeCloudSharedDataDownloadTool") as DHI.Solutions.GISManager.Tools.MikeCloudSharedDataTool.MikeCloudSharedDataDownloadTool;
// Set the tool properties and execute.
tool.InputItems.Add(featureClass);
tool.Attribute = "Attrib1";
tool.Execute();
// Get the output of the tool.
var outputFeatureClass = tool.OutputItems[0] as DHI.Solutions.GISManager.Interfaces.IFeatureClass;
Nearest Neighbour Interpolation¶
This tool interpolates point data producing a raster with values given by the specified attribute of the input feature class using the nearest neighbour algorithm, which assigns to every grid cell the value in the closest input point.
| Tool Info | Nearest Neighbour Interpolation |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.RasterInterpolation |
| API Reference | DHI.Solutions.GISManager.Tools.RasterInterpolation.INearestNeighbourInterpolationTool |
| Input Items | A single features or a single feature class |
| Output Items | A raster |
Tool Properties
- Attribute: Gets or sets the attribute to get values for the points to use in the interpolation
- MissingValue: Gets or sets the value to use when the distance to the closest points is bigger than radius
- Radius: Gets or sets the value for the maximum radius to the closest point so it's value is used in the interpolation -1 means infinite radius
- RasterDefinition: Gets or sets the definition for the output raster Coordinate system is not used. Instead, coordinate system for input feature class is used
- AutoScale: Gets or sets a value indicating whether the tool should automatically calculate scale when changing height and width, or height and width when changing scale. When AutoScale is true, the tool will keep the overall extent of the output raster the same as the input feature class within the precision of the scale factor in each dimension.
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Nearest Neighbour Interpolation") as DHI.Solutions.GISManager.Tools.RasterInterpolation.NearestNeighbourInterpolationTool;
// Set the tool properties and execute.
too.InputItems.Add(featureClass);
tool.Execute();
// Get the output of the tool.
var outputRaster = _testTool.OutputItems[0] as DHI.Solutions.GISManager.Interfaces.IRaster;
Radial Basis Interpolation¶
This tool interpolates point data producing a raster with values given by the specified attribute of the input point feature class using the radial basis algorithm,
which assigns to every grid cell a value calculated using a real-valued function whose value depends only on the distance from the origin f(x) = f(||x||)
or alternatively on the distance from some other point c, called a center f(x) = f(||x - c||).
Any function that satisfies the property is a radial function. Radial basis functions are typically used to build up function approximations
approximating function y(x) is represented as a sum of N radial basis functions, each associated with a different center xi, and weighted by an appropriate coefficient.
| Tool Info | Radial Basis Interpolation |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.RasterInterpolation |
| API Reference | DHI.Solutions.GISManager.Tools.RasterInterpolation.IRadialBasisInterpolationTool |
| Input Items | A single features or a single feature class |
| Output Items | A raster |
Tool Properties
- Attribute: Gets or sets the attribute to get values for the points to use in the interpolation
- RadialBasisFunction: Gets or sets a value for the to use to compute approximation functions
- RasterDefinition: Gets or sets the definition for the output raster Coordinate system is not used. Instead, coordinate system for input feature class is used
- ExtrapolateValues: Gets or sets a value indicating whether interpolated values are used even in case where they are bigger than maximum input value or smaller than minimum input value. Otherwise maximum and minimum values are used respectively.
- AutoScale: Gets or sets a value indicating whether the tool should automatically calculate scale when changing height and width, or height and width when changing scale. When AutoScale is true, the tool will keep the overall extent of the output raster the same as the input feature class within the precision of the scale factor in each dimension.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Radial Basis Interpolation") as DHI.Solutions.GISManager.Tools.RasterInterpolation.IRadialBasisInterpolationTool;
# Get the tool.
tool = app.Tools.CreateNew("Radial Basis Interpolation")
# Get the tool.
tool = DHI.Solutions.GISManager.Tools.RasterInterpolation.IRadialBasisInterpolationTool(app.Tools.CreateNew("Radial Basis Interpolation"))
Raster appearance¶
This tool will set the appearance for the raster by updating the symbology of the raster. The symbology is used when displaying the raster.
| Tool Info | Raster appearance |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.RasterProcessing |
| API Reference | DHI.Solutions.GISManager.Tools.RasterProcessing.IRasterAppearanceTool |
| Input Items | A single raster |
| Output Items | A raster |
Tool Properties
- RasterProcessor: Gets or sets the raster processor to use when executing the tool
- RasterStyleType: Gets or sets the style type of the raster
- LayerStyle: Gets or sets the style for the raster
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Raster appearance") as DHI.Solutions.GISManager.Tools.RasterProcessing.RasterAppearanceTool;
// Set the tool properties and execute.
tool.InputItems.Add(raster);
tool.RasterStyleType = DHI.Solutions.GISManager.Interfaces.RasterStyleType.ValueRanges;
tool.Execute();
// Get the output of the tool.
var outRaster = tool.OutputItems[0] as DHI.Solutions.GISManager.Interfaces.IRaster;
Raster Calculator¶
Tool for performing raster math on one or more input rasters.
| Tool Info | Raster Calculator |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.RasterProcessing |
| API Reference | DHI.Solutions.GISManager.Tools.RasterProcessing.IRasterCalculatorTool |
| Input Items | One or more rasters |
| Output Items | A raster |
Tool Properties
- Formula: Gets or sets the formula to be used for calculating rasters The formula syntax is based on SpreadsheetGear (which itself is based on Microsoft Excel). Instead of cell references, however, formulas are to be entered using raster names in brackets. (e.g. "[myraster]"). The link between the raster name and the actual rasters are to be mapped in the Mapping property.
- NameMapping: Gets or sets the mapping of names used in the formula to the input rasters.
- TemporalOutput: Gets or sets a value indicating whether the output is a temporal raster
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Raster Calculator") as DHI.Solutions.GISManager.Tools.RasterProcessing.IRasterCalculatorTool;
# Get the tool.
tool = app.Tools.CreateNew("Raster Calculator")
# Get the tool.
tool = DHI.Solutions.GISManager.Tools.RasterProcessing.IRasterCalculatorTool(app.Tools.CreateNew("Raster Calculator"))
Raster Group Tools¶
tools for the group processing
| Tool Info | Raster Group Tools |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.RasterGroupProcessing |
| API Reference | DHI.Solutions.GISManager.Tools.RasterGroupProcessing.IRasterGroupTool |
| Input Items | A single raster group |
| Output Items | No output items |
Tool Properties
- RasterProcessor: Gets or sets the raster processor to use when executing the tool
- OutputGroupRootPath: Gets or sets the output group path.
- CellSize: Gets or sets the size of the cell.
- TileWidth: Gets or sets the width of the tile.
- TileHeight: Gets or sets the height of the tile.
- CoordinateSystem: Gets or sets the coordinate system to project to
- InterpolationMethod: Gets or sets the interpolation method to use
- DuplicateNameOption: Gets or sets the option to be chosen when a feature with the same name is already present in the group
- RasterGroupProcesingType: Gets or sets the type of the raster group procesing.
- TemplateRaster: Gets or sets the template raster.
- AddSourceRoot: Gets or sets a value indicating whether [add source root].
- KeepVisibilityScale: Gets or sets a value indicating whether [keep visibility scale].
- KeepResampelingLocation: Gets or sets a value indicating whether [keep resampeling location].
- LowerScaleVisibility: Gets or sets the lower scale visibility.
- UpperrScaleVisibility: Gets or sets the upperr scale visibility.
- ZoomLevel: Gets or sets the zoom level.
- CoordinateSystemName: Gets or sets the coordinate system name.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Raster Group Tools ") as DHI.Solutions.GISManager.Tools.RasterGroupProcessing.IRasterGroupTool;
# Get the tool.
tool = app.Tools.CreateNew("Raster Group Tools ")
# Get the tool.
tool = DHI.Solutions.GISManager.Tools.RasterGroupProcessing.IRasterGroupTool(app.Tools.CreateNew("Raster Group Tools "))
Raster Project¶
A tool for projecting rasters to a different coordinate system.
| Tool Info | Raster Project |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.RasterProcessing |
| API Reference | DHI.Solutions.GISManager.Tools.RasterProcessing.IRasterProjectTool |
| Input Items | One or more rasters |
| Output Items | A raster |
Tool Properties
- RasterProcessor: Gets or sets the raster processor to use when executing the tool
- CoordinateSystem: Gets or sets the coordinate system to project to
- InterpolationMethod: Gets or sets the interpolation method to use
- CoordinateSystemName: Gets or sets the coordinate system name.
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Raster Project") as DHI.Solutions.GISManager.Tools.RasterProcessing.RasterProjectTool;
// Set the tool properties and execute.
var module = application.Modules.Get("GIS Manager") as DHI.Solutions.GISManager.Interfaces.IGISModule;
var raster = module.RasterList.Fetch("/smallOresund/H Water Depth m");
tool.InputItems.Add(raster);
tool.CoordinateSystemName = "WGS 84 / UTM zone 33N";
tool.InterpolationMethod = DHI.Solutions.GISManager.Interfaces.RasterInterpolationMethod.Cubic;
tool.Execute();
// Get the output of the tool.
var projectedTaster = tool.OutputItems[0] as DHI.Solutions.GISManager.Interfaces.IRaster;
Raster query¶
RasterQueryTool class
| Tool Info | Raster query |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.RasterQuery |
| API Reference | DHI.Solutions.GISManager.Tools.RasterQueryTool.RasterQueryTool |
| Input Items | No input items required |
| Output Items | No output items |
Tool Properties
The tool has no properties.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Raster query") as DHI.Solutions.GISManager.Tools.RasterQueryTool.RasterQueryTool;
# Get the tool.
tool = app.Tools.CreateNew("Raster query")
Raster Resample¶
A tool for resampling rasters to a different cell size.
| Tool Info | Raster Resample |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.RasterProcessing |
| API Reference | DHI.Solutions.GISManager.Tools.RasterProcessing.IRasterResampleTool |
| Input Items | One or more rasters |
| Output Items | A raster |
Tool Properties
- RasterProcessor: Gets or sets the raster processor to use when executing the tool
- RasterDefinition: Gets or sets the definition for the resampled raster. Coordinate system is not used.
- InterpolationMethod: Gets or sets the interpolation method to use
- AutoScale: Gets or sets a value indicating whether the tool should automatically calculate scale when changing height and width, or height and width when changing scale. When AutoScale is true, the tool will keep the overall extent of the output raster the same as the input raster within the precision of the scale factor in each dimension.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Raster Resample") as DHI.Solutions.GISManager.Tools.RasterProcessing.IRasterResampleTool;
# Get the tool.
tool = app.Tools.CreateNew("Raster Resample")
# Get the tool.
tool = DHI.Solutions.GISManager.Tools.RasterProcessing.IRasterResampleTool(app.Tools.CreateNew("Raster Resample"))
Raster To Database¶
A tool for saving a raster to the database
| Tool Info | Raster To Database |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.RasterToDatabase |
| API Reference | DHI.Solutions.GISManager.Tools.RasterToDatabaseTool.IRasterToDatabaseTool |
| Input Items | One or more rasters |
| Output Items | No output items |
Tool Properties
- DuplicateNameOption: Gets or sets the option to be chosen when a raster with the same name is already present in the group
- Group: Gets or sets the group in which to save the raster
- NameOption: Gets or sets the option to specify the name of the saved raster
- RasterDataProvider: Gets or sets the to save the raster to
- RasterName: Gets or sets the name of the raster to be saved Requires
- NamePostFix: Gets or sets the postfix to be added to the name of the input raster when saving Requires
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Raster To Database") as DHI.Solutions.GISManager.Tools.RasterToDatabaseTool.IRasterToDatabaseTool;
# Get the tool.
tool = app.Tools.CreateNew("Raster To Database")
# Get the tool.
tool = DHI.Solutions.GISManager.Tools.RasterToDatabaseTool.IRasterToDatabaseTool(app.Tools.CreateNew("Raster To Database"))
Raster To Display¶
A tool for displaying rasters on a map.
| Tool Info | Raster To Display |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.RasterToDisplay |
| API Reference | DHI.Solutions.GISManager.UI.Tools.RasterToDisplayTool.IRasterToDisplayTool |
| Input Items | One or more rasters |
| Output Items | No output items |
Tool Properties
- AvailableOutputs: Gets the list of available outputs that can be used to display
- Action: Gets or sets the action to perform when displaying data in output
- Output: Gets or sets the output to use to display data
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Raster To Display") as DHI.Solutions.GISManager.UI.Tools.RasterToDisplayTool.IRasterToDisplayTool;
# Get the tool.
tool = app.Tools.CreateNew("Raster To Display")
# Get the tool.
tool = DHI.Solutions.GISManager.UI.Tools.RasterToDisplayTool.IRasterToDisplayTool(app.Tools.CreateNew("Raster To Display"))
Raster to Vector¶
A tool for converting rasters to vectors (features).
| Tool Info | Raster to Vector |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.RasterProcessing |
| API Reference | DHI.Solutions.GISManager.Tools.RasterProcessing.IRasterToVectorTool |
| Input Items | One or more rasters |
| Output Items | A feature class |
Tool Properties
- RasterProcessor: Gets or sets the raster processor to use when executing the tool
- ValueRanges: Gets or sets a value for ValueRanges The value ranges in raster band to create geometries for If not specified, all values are used
- RasterBand: Gets or sets the index of the raster band in the raster to get values from
- Tolerance: Gets or sets the tolerance in raster coordinate system used for the simplification of geometries
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Raster to Vector") as DHI.Solutions.GISManager.Tools.RasterProcessing.RasterToVectorTool;
// Set the tool properties and execute.
var module = application.Modules.Get("GIS Manager") as DHI.Solutions.GISManager.Interfaces.IGISModule;
var raster = module.RasterList.Fetch("/small_raster");
tool.InputItems.Add(raster);
tool.RasterBand = 0;
tool.Tolerance = 0.5;
var valueRanges = new System.Collections.Generic.List<DHI.Solutions.GISManager.Interfaces.IValueRange>();
valueRanges.Add(new DHI.Solutions.GISManager.Common.ValueRange() { MinValue = 0, MaxValue = 5 });
valueRanges.Add(new DHI.Solutions.GISManager.Common.ValueRange() { MinValue = 5, MaxValue = 10 });
valueRanges.Add(new DHI.Solutions.GISManager.Common.ValueRange() { MinValue = 10, MaxValue = 20 });
valueRanges.Add(new DHI.Solutions.GISManager.Common.ValueRange() { MinValue = 20, MaxValue = 50 });
tool.ValueRanges = valueRanges;
tool.Execute();
// Get the output of the tool.
var featureClass = tool.OutputItems[0] as DHI.Solutions.GISManager.Interfaces.IFeatureClass;
Reclassification¶
A tool for reclassifying raster values based on a value mapping.
| Tool Info | Reclassification |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.RasterProcessing |
| API Reference | DHI.Solutions.GISManager.Tools.RasterProcessing.IRasterReclassificationTool |
| Input Items | One or more rasters |
| Output Items | A raster |
Tool Properties
- KeepUnmappedValues: Gets or sets a value indicating whether unmapped values are kept or replaced by null
- Mapping: Gets or sets he mapping of values. If is SingleValue, the keys in the dictionary shall be single values. If is ValueRange, the keys in the dictionary shall be The mapping values data type depends on the and values will be converted accordingly.
- MappingType: Gets or sets the mapping type to use
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Reclassification") as DHI.Solutions.GISManager.Tools.RasterProcessing.IRasterReclassificationTool;
# Get the tool.
tool = app.Tools.CreateNew("Reclassification")
# Get the tool.
tool = DHI.Solutions.GISManager.Tools.RasterProcessing.IRasterReclassificationTool(app.Tools.CreateNew("Reclassification"))
Slope¶
A tool for calculating the slope of a raster surface
| Tool Info | Slope |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.RasterProcessing |
| API Reference | DHI.Solutions.GISManager.Tools.RasterProcessing.IRasterSlopeTool |
| Input Items | One or more rasters |
| Output Items | A raster |
Tool Properties
The tool has no properties.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Slope") as DHI.Solutions.GISManager.Tools.RasterProcessing.IRasterSlopeTool;
# Get the tool.
tool = app.Tools.CreateNew("Slope")
# Get the tool.
tool = DHI.Solutions.GISManager.Tools.RasterProcessing.IRasterSlopeTool(app.Tools.CreateNew("Slope"))
Slope Length¶
A tool for calculating the slope of a raster surface.
| Tool Info | Slope Length |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.RasterProcessing |
| API Reference | DHI.Solutions.GISManager.Tools.RasterProcessing.ISlopeLengthTool |
| Input Items | One or more rasters |
| Output Items | A raster |
Tool Properties
- SlopeBreak: Gets or sets the break in slope in percent that will mark the downstream end of the slope.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Slope Length") as DHI.Solutions.GISManager.Tools.RasterProcessing.ISlopeLengthTool;
# Get the tool.
tool = app.Tools.CreateNew("Slope Length")
# Get the tool.
tool = DHI.Solutions.GISManager.Tools.RasterProcessing.ISlopeLengthTool(app.Tools.CreateNew("Slope Length"))
Soil Erosion Crop Management (C)¶
| Tool Info | Soil Erosion Crop Management (C) |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.SoilErosion |
| API Reference | DHI.Solutions.GISManager.Tools.SoilErosion.ISoilErosionCTool |
| Input Items | A single raster or a single feature class |
| Output Items | A raster |
Tool Properties
- CropTypeAttribute: Gets or sets the attribute of the input feature class that indicates the crop type
- Mapping: Gets or sets the mapping of values. The keys in the dictionary shall be values representing each type. The mapping values data type shall be single values.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Soil Erosion Crop Management (C)") as DHI.Solutions.GISManager.Tools.SoilErosion.ISoilErosionCTool;
# Get the tool.
tool = app.Tools.CreateNew("Soil Erosion Crop Management (C)")
# Get the tool.
tool = DHI.Solutions.GISManager.Tools.SoilErosion.ISoilErosionCTool(app.Tools.CreateNew("Soil Erosion Crop Management (C)"))
Soil Erosion Erosion Control (P)¶
| Tool Info | Soil Erosion Erosion Control (P) |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.SoilErosion |
| API Reference | DHI.Solutions.GISManager.Tools.SoilErosion.ISoilErosionPTool |
| Input Items | A single raster or a single feature class |
| Output Items | A raster |
Tool Properties
- ControlTypeAttribute: Gets or sets the attribute of the input feature class that indicates the erosion control type
- Mapping: Gets or sets the mapping of values. The keys in the dictionary shall be values representing each type. The mapping values data type shall be single values.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Soil Erosion Erosion Control (P)") as DHI.Solutions.GISManager.Tools.SoilErosion.ISoilErosionPTool;
# Get the tool.
tool = app.Tools.CreateNew("Soil Erosion Erosion Control (P)")
# Get the tool.
tool = DHI.Solutions.GISManager.Tools.SoilErosion.ISoilErosionPTool(app.Tools.CreateNew("Soil Erosion Erosion Control (P)"))
Soil Erosion Mean Annual Soil Loss (A)¶
| Tool Info | Soil Erosion Mean Annual Soil Loss (A) |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.SoilErosion |
| API Reference | DHI.Solutions.GISManager.Tools.SoilErosion.ISoilErosionATool |
| Input Items | One or more rasters |
| Output Items | A raster |
Tool Properties
- RainfallErosivityFactor: Gets or sets the raster representing the rainfall erosivity factor (R) of the RUSLE soil erosion formula.
- SoilErodibilityFactor: Gets or sets the raster representing the soil erodibility factor (K) of the RUSLE soil erosion formula.
- SlopeLengthFactor: Gets or sets the raster representing the slope length factor (LS) of the RUSLE soil erosion formula.
- CropManagementFactor: Gets or sets the raster representing the crop management factor (C) of the RUSLE soil erosion formula.
- ErosionControlFactor: Gets or sets the raster representing the erosion control factor (P) of the RUSLE soil erosion formula.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Soil Erosion Mean Annual Soil Loss (A)") as DHI.Solutions.GISManager.Tools.SoilErosion.ISoilErosionATool;
# Get the tool.
tool = app.Tools.CreateNew("Soil Erosion Mean Annual Soil Loss (A)")
# Get the tool.
tool = DHI.Solutions.GISManager.Tools.SoilErosion.ISoilErosionATool(app.Tools.CreateNew("Soil Erosion Mean Annual Soil Loss (A)"))
Soil Erosion Rainfall Erosivity (R)¶
| Tool Info | Soil Erosion Rainfall Erosivity (R) |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.SoilErosion |
| API Reference | DHI.Solutions.GISManager.Tools.SoilErosion.ISoilErosionRTool |
| Input Items | One or more rasters |
| Output Items | A raster |
Tool Properties
- Formula: Gets or sets the raster calculator formula to use for calculating R
- NameMapping: Gets or sets the mapping of names used in the formula to the input rasters.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Soil Erosion Rainfall Erosivity (R)") as DHI.Solutions.GISManager.Tools.SoilErosion.ISoilErosionRTool;
# Get the tool.
tool = app.Tools.CreateNew("Soil Erosion Rainfall Erosivity (R)")
# Get the tool.
tool = DHI.Solutions.GISManager.Tools.SoilErosion.ISoilErosionRTool(app.Tools.CreateNew("Soil Erosion Rainfall Erosivity (R)"))
Soil Erosion Rainfall Erosivity (R) (extended)¶
Soil erosion tool
| Tool Info | Soil Erosion Rainfall Erosivity (R) (extended) |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.SoilErosionR |
| API Reference | DHI.Solutions.GISManager.Tools.SoilErosionRTool.ISoilErosionRTool |
| Input Items | One or more time series |
| Output Items | A raster |
Tool Properties
- ResampligTimeStepInterval: Gets or sets the time step interval. The interval to use to resample the input data so that correct multiplication factor to convert fixed intervals into break points (where rainfall intensity changes during a storm) can be applied. Multiplication factors according to resampling time step interval are: 60 min �?1.730, 30 min �?1.161, 15 min �?1.078, 10 min �?1.044 and 5 min �?1.014
- CatchmentFeatureClass: Gets or sets the feature class with catchments. Shall have the same coordinate system as StationsFeatureClass
- StationsFeatureClass: Gets or sets the feature class with rainfall stations. Shall have the same coordinate system as CatchmentFeatureClass
- RasterHeight: Gets or sets the value of raster height
- RasterWidth: Gets or sets the value of raster width
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Soil Erosion Rainfall Erosivity (R) (extended)") as DHI.Solutions.GISManager.Tools.SoilErosionRTool.ISoilErosionRTool;
# Get the tool.
tool = app.Tools.CreateNew("Soil Erosion Rainfall Erosivity (R) (extended)")
# Get the tool.
tool = DHI.Solutions.GISManager.Tools.SoilErosionRTool.ISoilErosionRTool(app.Tools.CreateNew("Soil Erosion Rainfall Erosivity (R) (extended)"))
Soil Erosion Slope Length (LS)¶
| Tool Info | Soil Erosion Slope Length (LS) |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.SoilErosion |
| API Reference | DHI.Solutions.GISManager.Tools.SoilErosion.ISoilErosionLSTool |
| Input Items | A single raster |
| Output Items | A raster |
Tool Properties
The tool has no properties.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Soil Erosion Slope Length (LS)") as DHI.Solutions.GISManager.Tools.SoilErosion.ISoilErosionLSTool;
# Get the tool.
tool = app.Tools.CreateNew("Soil Erosion Slope Length (LS)")
# Get the tool.
tool = DHI.Solutions.GISManager.Tools.SoilErosion.ISoilErosionLSTool(app.Tools.CreateNew("Soil Erosion Slope Length (LS)"))
Soil Erosion Soil Erodibility (K)¶
| Tool Info | Soil Erosion Soil Erodibility (K) |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.SoilErosion |
| API Reference | DHI.Solutions.GISManager.Tools.SoilErosion.ISoilErosionKTool |
| Input Items | A single raster or a single feature class |
| Output Items | A raster |
Tool Properties
- SoilTypeAttribute: Gets or sets the attribute of the input feature class that indicates the soil type. Shall be ignored if input is Raster.
- Mapping: Gets or sets the mapping of values. The keys in the dictionary shall be values representing each type. The mapping values data type shall be single values.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Soil Erosion Soil Erodibility (K)") as DHI.Solutions.GISManager.Tools.SoilErosion.ISoilErosionKTool;
# Get the tool.
tool = app.Tools.CreateNew("Soil Erosion Soil Erodibility (K)")
# Get the tool.
tool = DHI.Solutions.GISManager.Tools.SoilErosion.ISoilErosionKTool(app.Tools.CreateNew("Soil Erosion Soil Erodibility (K)"))
Temporal DisaggregationTool¶
A tool for convert vector to raster.
| Tool Info | Temporal DisaggregationTool |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.TemporalRaster |
| API Reference | DHI.Solutions.GISManager.Tools.Temporal.ITemporalDisaggregationTool |
| Input Items | A single feature class |
| Output Items | A time series |
Tool Properties
- Attribute: Gets or sets the name of the attribute to disaggregated into time series
- Fractions: Gets or sets the fractions to use in the disaggregation. A fraction is a definition of the time series, the weight and the threshold to use
- IdAttribute: Gets or sets the name of the attribute to identify feature in the input feature class
- Unit: Gets or sets the unit.
- Variable: Gets or sets the variable.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Temporal DisaggregationTool") as DHI.Solutions.GISManager.Tools.Temporal.ITemporalDisaggregationTool;
# Get the tool.
tool = app.Tools.CreateNew("Temporal DisaggregationTool")
# Get the tool.
tool = DHI.Solutions.GISManager.Tools.Temporal.ITemporalDisaggregationTool(app.Tools.CreateNew("Temporal DisaggregationTool"))
Temporal Zonal Statistics Tool¶
Temporal zonal statistics tool
| Tool Info | Temporal Zonal Statistics Tool |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.TemporalRaster |
| API Reference | DHI.Solutions.GISManager.Tools.Temporal.ITemporalZonalStatisticsTool |
| Input Items | A single feature class |
| Output Items | A time series |
Tool Properties
- RasterProcessor: Gets or sets the raster processor to use when executing the tool
- Attribute: Gets or sets the the name of the attribute to identify features in the input feature class and be used when naming time series
- Raster: Gets or sets the raster to calculate zonal statistics.
- Group: Gets or sets the group in which to save the timeseries
- NamePostFix: Gets or sets the postfix string to be added to the timeseries name.e.g. TimeseriesA Postfix
- TimeseriesName: Gets or sets the name to be added to the timeseries, e.g. MyTs, MyTs (1), MyTs(2) etc
- DuplicateNameOption: Gets or sets the option to be chosen when a timeseres with the same name is already present in the group and if time series will be saved in database
- SelectedStatistics: Gets or sets the selected statistics.
- TimeSeriesValueType: Gets or sets the time series value type
- TimeSeriesVariable: Gets or sets the value of time series variable
- TimeseriesUnit: Gets or sets the value of time series unit
- SaveToDatabase: Gets or sets a value indicating whether to save to database
- AssociateTsToFeatures: Gets or sets a value indicating whether to associate TS with features
- RasterDataProvider: Gets or sets the raster data provider to use.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Temporal Zonal Statistics Tool") as DHI.Solutions.GISManager.Tools.Temporal.ITemporalZonalStatisticsTool;
# Get the tool.
tool = app.Tools.CreateNew("Temporal Zonal Statistics Tool")
# Get the tool.
tool = DHI.Solutions.GISManager.Tools.Temporal.ITemporalZonalStatisticsTool(app.Tools.CreateNew("Temporal Zonal Statistics Tool"))
Thiessen Polygons¶
A tool for calculating Thiessen polygons from a set of points.
| Tool Info | Thiessen Polygons |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.GeoProcessing |
| API Reference | DHI.Solutions.GISManager.Tools.GeoProcessing.IThiessenPolygonTool |
| Input Items | A single feature class or a single features |
| Output Items | A feature class |
Tool Properties
- GISProcessor: Gets or sets the GIS processor to use when executing the tool
- ThiessenPolygonsFeatureClassName: Gets or sets name of the new feature class containing the Thiessen Polygons.
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Thiessen Polygons") as DHI.Solutions.GISManager.Tools.GeoProcessing.ThiessenPolygonTool;
// Set the tool properties and execute.
var gisModule = application.Modules.Get("GIS Manager") as DHI.Solutions.GISManager.Interfaces.IGISModule;
var cities = gisModule.DefaultGISDataProvider.FeatureClassList.Fetch("/Cities");
cities.Query(new DHI.Solutions.Generic.Query());
tool.InputItems.Add(cities);
tool.ThiessenPolygonsFeatureClassName = "ThiessenPolygonsCities";
tool.Execute();
// Get the output of the tool.
var outputFeatureClass = tool.OutputItems[0] as DHI.Solutions.GISManager.Interfaces.IFeatureClass;
Time Series to Temporal Raster¶
This tool creates a temporal raster from a set of timeseries and a point feature class. It uses the tool “TimeSeries Step To Feature” and its help should be consulted for more information on the timeseries selection.
| Tool Info | Time Series to Temporal Raster |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.TemporalRaster |
| API Reference | DHI.Solutions.GISManager.Tools.Temporal.TimeSeriesToTemporalRasterTool |
| Input Items | A single feature class |
| Output Items | A raster |
Tool Properties
- TSNamePattern: Gets or sets the value of TS name pattern
- TSGroupName: Gets or sets the value of TS group name
- UseAssociation: Gets or sets a value indicating whether to use association
- TsNameFeatureAttributeName: Gets or sets the value of TS name feature attribute
- StartTime: Gets or sets the start time.
- EndTime: Gets or sets the end time.
- TimeStep: Gets or sets the time step.
- TimeStepUnit: Gets or sets the time step unit.
- RasterDefinition: Gets or sets the definition for the output raster Coordinate system is not used. Instead, coordinate system for input feature class is used
- AutoScale: Gets or sets a value indicating whether the tool should automatically calculate scale when changing height and width, or height and width when changing scale. When AutoScale is true, the tool will keep the overall extent of the output raster the same as the input feature class within the precision of the scale factor in each dimension.
- RasterName: Gets or sets the rastername.
- RasterGroup: Gets or sets the value of raster group
- AddAssociation: Gets or sets a value indicating whether to add an association.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Time Series to Temporal Raster") as DHI.Solutions.GISManager.Tools.Temporal.TimeSeriesToTemporalRasterTool;
# Get the tool.
tool = app.Tools.CreateNew("Time Series to Temporal Raster")
TimeSeries Step To Features Tool¶
This tool copies timeseries values to features in a feature class.
| Tool Info | TimeSeries Step To Features Tool |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.TemporalRaster |
| API Reference | DHI.Solutions.GISManager.Tools.Temporal.TimeSeriesStepToFeaturesTool |
| Input Items | A single feature class |
| Output Items | No output items |
Tool Properties
- RasterProcessor: Gets or sets the raster processor to use when executing the tool
- TSNamePattern: Gets or sets a rtegular expression used to filter timeseries by name. If this is left empty, the tool will assume a one to one match between the names written in the attribute table and the timeseries names.
- TSGroupName: Gets or sets the value of time series group name group that contains the timeseries to use to populate the feature class attribute table.
- UseAssociation: Gets or sets a value indicating whether timeseries associated to each feature will be considered when applying the mask. If set to false, a timeseries group will need to be defined.
- TargetFeatureAttributeName: Gets or sets the attribute to which the timeseries values will written. If it does not exist, it will be created. If it exists, values will be overwritten.
- TsNameFeatureAttributeName: Gets or sets the attribute storing the string that will be used to select which timeseries to read the value from. This will be used along with the regular expression.
- AssociatedTS: Gets the value of TS and feature association dictionary
- TimeStep: Gets or sets the value of time step
- UseLastValue: Gets or sets a value indicating whether the last timestep from of the selected timeseries will be written to the attribute table. If set to False, the timestep to pick will need to be specified. If the timestep does not exist, the value will be Null.
- AddAssociation: Gets or sets a value indicating whether the timeseries used will be associate to the corresponding feature in the feature class.
Tool Methods
- ResetAssociation(): Resets associations, so that associated time series and features to update matches the tool properties.
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("TimeSeries Step To Features Tool") as DHI.Solutions.GISManager.Tools.Temporal.TimeSeriesStepToFeaturesTool;
// Set the tool properties and execute.
tool.InputItems.Add(featureClass);
tool.AddAssociation = true;
tool.TSNamePattern = @"([\w\s\d\.]*)_rainfall";
tool.TargetFeatureAttributeName = "val1";
tool.TsNameFeatureAttributeName = "tsname";
tool.TimeStep = new DateTime(1961, 8, 24, 5, 0, 0);
tool.UseLastValue = false;
tool.TSGroupName = "/tsdata";
tool.UseAssociation = false;
tool.Execute();
To attribute table¶
Class of the ToAttributeTable tool
| Tool Info | To attribute table |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.ToAttributeTable |
| API Reference | DHI.Solutions.GISManager.UI.Tools.ToAttributeTable.ToAttributeTable |
| Input Items | One or more feature classes |
| Output Items | No output items |
Tool Properties
- TableDisplayOptions:
- TableOutputName:
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("To attribute table") as DHI.Solutions.GISManager.UI.Tools.ToAttributeTable.ToAttributeTable;
# Get the tool.
tool = app.Tools.CreateNew("To attribute table")
To database¶
ToDatabaseTool exports input feature to file
| Tool Info | To database |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.ToDatabase |
| API Reference | DHI.Solutions.GISManager.Tools.ToDatabaseTool.IToDatabaseTool |
| Input Items | One or more feature classes or one or more features |
| Output Items | No output items |
Tool Properties
- DuplicateNameOption: Gets or sets the option to be chosen when a feature with the same name is already present in the group
- Group: Gets or sets the group in which to save the feature class
- NameOption: Gets or sets the option to specify the name of the saved feature class
- DataProvider: Gets or sets the to save the feature class to
- FeatureClassName: Gets or sets the name of the feature class to be saved Requires
- NamePostFix: Gets or sets the postfix string to be added to the feature class name
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("To database") as DHI.Solutions.GISManager.Tools.ToDatabaseTool.IToDatabaseTool;
# Get the tool.
tool = app.Tools.CreateNew("To database")
# Get the tool.
tool = DHI.Solutions.GISManager.Tools.ToDatabaseTool.IToDatabaseTool(app.Tools.CreateNew("To database"))
To display¶
ToDisplayTool exports input feature to file
| Tool Info | To display |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.ToDisplay |
| API Reference | DHI.Solutions.GISManager.Tools.ToDisplayTool.IToDisplayTool |
| Input Items | One or more feature classes or one or more meshs |
| Output Items | No output items |
Tool Properties
- AvailableOutputs: Gets the list of available outputs that can be used to display
- Action: Gets or sets the action to perform when displaying data in output
- Output: Gets or sets the output to use to display data
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("To display") as DHI.Solutions.GISManager.Tools.ToDisplayTool.IToDisplayTool;
# Get the tool.
tool = app.Tools.CreateNew("To display")
# Get the tool.
tool = DHI.Solutions.GISManager.Tools.ToDisplayTool.IToDisplayTool(app.Tools.CreateNew("To display"))
Union Feature Classes¶
The Union Feature Classes tool creates a geometric intersection of the input feature classes. All overlapping and non-overlapping features will be written to the output feature class.
| Tool Info | Union Feature Classes |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.GeoProcessing |
| API Reference | DHI.Solutions.GISManager.Tools.GeoProcessing.IUnionTool |
| Input Items | Two feature classes |
| Output Items | A feature class |
Tool Properties
- GISProcessor: Gets or sets the GIS processor to use when executing the tool
- UnionFeatureClassName: Gets or sets the Name of new Union Feature Class.
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Union Feature Classes") as DHI.Solutions.GISManager.Tools.GeoProcessing.UnionTool;
// Set the tool properties and execute.
tool.InputItems.Add(featureClass1);
tool.InputItems.Add(featureClass2);
tool.UnionFeatureClassName = "UnionFeatureClassName";
tool.Execute();
// Get the output of the tool.
var outputFeatureClass = tool.OutputItems[0] as DHI.Solutions.GISManager.Interfaces.IFeatureClass;
Vector to Raster¶
Tool for converting a feature class to a raster using attribute values for each of the features in the feature class to fill in the raster.
| Tool Info | Vector to Raster |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.RasterProcessing |
| API Reference | DHI.Solutions.GISManager.Tools.RasterProcessing.IVectorToRasterTool |
| Input Items | A single features or a single feature class |
| Output Items | A raster |
Tool Properties
- RasterProcessor: Gets or sets the raster processor to use when executing the tool
- Attribute: Gets or sets the attribute to get values for the geometries to fill in the raster
- RasterDefinition: Gets or sets the definition for the output raster. Coordinate system is not used.Instead, coordinate system for input feature class is used
- MissingValue: Gets or sets the value to use when data is missing.
- AutoScale: Gets or sets a value indicating whether the tool should automatically calculate scale when changing height and width, or height and width when changing scale. When AutoScale is true, the tool will keep the overall extent of the output raster the same as the input feature class within the precision of the scale factor in each dimension.
Code Sample
// Get the tool
var tool = application.Tools.CreateNew("Vector to Raster") as DHI.Solutions.GISManager.Tools.RasterProcessing.VectorToRasterTool;
// Set the tool properties and execute.
tool.InputItems.Add(featureClass);
tool.AutoScale = true;
tool.RasterDefinition.Width = 10;
tool.Execute();
// Get the output of the tool.
var outputRaster = tool.OutputItems[0] as DHI.Solutions.GISManager.Interfaces.IRaster;
Zonal Statistics¶
Tool for calculating statistics on raster values for polygons, lines or points. The tool will create feature attributes for each selected statistics.
| Tool Info | Zonal Statistics |
|---|---|
| NuGet Package | DHI.MikeOperations.GISManager.Tools.RasterProcessing |
| API Reference | DHI.Solutions.GISManager.Tools.RasterProcessing.IZonalStatisticsTool |
| Input Items | A single feature class |
| Output Items | A feature class |
Tool Properties
- RasterProcessor: Gets or sets the raster processor to use when executing the tool
- RasterBand: Gets or sets the index of the raster band in the raster to get values from
- Raster: Gets or sets the raster to calculate zonal statistics.
- SelectedStatistics: Gets or sets the selected statistics (Avarage, Maximum, Minimum, NrMissingValues, StDev, Sum).
- RasterDataProvider: Gets or sets the raster data provider to use.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Zonal Statistics") as DHI.Solutions.GISManager.Tools.RasterProcessing.IZonalStatisticsTool;
# Get the tool.
tool = app.Tools.CreateNew("Zonal Statistics")
# Get the tool.
tool = DHI.Solutions.GISManager.Tools.RasterProcessing.IZonalStatisticsTool(app.Tools.CreateNew("Zonal Statistics"))