VERIFIED SOLUTION i
X

How to create an IndividualValueTheme which is based on a join from another table - MapXtreme .NET

UPDATED: January 2, 2018


An IndividualValueTheme(IVT) is always applied on a layer in MapXtreme®. Before creating the IVT the tables used need to be joined and the IResultSetFeatureCollection (IRFC) needs to be created. Then the IRFC.Table can be used to create a Feature Layer and then a IVT can be created on this Feature Layer.

The following code summarizes the steps:

string expression = "Pop_1980 + 100"; 
Table table1 = _catalog.OpenTable(Path.Combine(_dataDir, "usa_extra.tab")); // contains column Pop_1980, ... etc.Table table2 = _catalog.OpenTable(Path.Combine(_dataDir, "States.tab")); // contains column Pop_1990, ... etc. 
//CREATE JOIN ON TABLE1 & TABLE2MIConnection miconn = new MIConnection();
MICommand mic = miconn.CreateCommand();

// make JOIN statement as per your requirementmic.CommandText = "SELECT usa_extra.* FROM usa_extra, States WHERE usa_extra.Pop_1980 < States.Pop_1990"; 
miconn.Open();
IResultSetFeatureCollection irsfc = mic.ExecuteFeatureCollection();

// Create layer from above result setFeatureLayer fLyr = new FeatureLayer(irsfc.Table);

// Create IVT as per expressionIndividualValueTheme ivt = new IndividualValueTheme(fLyr, expression, "alias_ivt");
 

Environment Details

Products Affected: MapXtreme.NET

Downloads

  • No Downloads