Help for PolygonCategory FilterExpression Problem

Aug 19, 2011 at 8:54 AM

Hi everyone,

 

I´m trying  According to the value of CLS to determine the color of the block on layer(CLS in attribute).
But the result has no effect
it's my code:
-------------------------------------------------------------------------------------------------------------------
 const string pjtb = @"Data Source=F:\818yj\pjtb.sqlite;"; 
 MapPolygonLayer pjtb_m = (MapPolygonLayer)this.map1.Layers.Add(test.Open(pjtb, "yjpjID", "CLS", "Geometry"));
 
  PolygonScheme myScheme = new PolygonScheme();
  myScheme.Categories.Clear();
  PolygonCategory low = new PolygonCategory(Color.Yellow, Color.Red, 1);
  low.FilterExpression = "[CLS] < 6";
  low.LegendText = "Low";
   PolygonCategory high = new PolygonCategory(Color.Red, Color.Blue, 1);
   high.FilterExpression = "[CLS] >= 6";
   high.LegendText = "high";
   myScheme.AppearsInLegend = true;
   myScheme.LegendText = "Tile ID";
   myScheme.Categories.Add(low);
   myScheme.Categories.Add(high);
   pjtb_m.Symbology = myScheme;
--------------------------------------------------------------------------------------------------------------------
Any help will be appreciated.

Regards,

S.G.