This project is read-only.

Symbolization

Dec 22, 2013 at 8:06 PM
Edited Dec 23, 2013 at 8:30 AM
Hi,

I'm trying to symbolize my shapefile according to some field values but after trying dozens of ways, I can't manage to get a result. All my points look the same with a default diamond shape.

Here is my code, any help would be much appreciated !

Olivier
          Dim ct1 As MapWinGIS.ShapefileCategory
            ct1 = shpf.Categories.Add("V1")
            ct1.Expression = "[REF] = 'V1'"
            ct1.DrawingOptions.Visible = True
            ct1.DrawingOptions.PointType = MapWinGIS.tkPointSymbolType.ptSymbolStandard
            ct1.DrawingOptions.PointShape = MapWinGIS.tkPointShapeType.ptShapeArrow

            ct1.DrawingOptions.PointSidesCount = 5                                       'number of sides
            ct1.DrawingOptions.PointSidesRatio = 0.5                                     'side ratio
            ct1.DrawingOptions.PointSize = 20                                             'point size
            ct1.DrawingOptions.PointRotation = 18                                        'point rotation
            ct1.DrawingOptions.FillVisible = True                                        'show the fill

            Dim ct2 As MapWinGIS.ShapefileCategory
            ct2 = shpf.Categories.Add("V2")
            ct2.Expression = "[REF] = 'V2'"
            ct2.DrawingOptions.PointType = MapWinGIS.tkPointSymbolType.ptSymbolStandard
            ct2.DrawingOptions.PointShape = MapWinGIS.tkPointShapeType.ptShapeCircle

            'ct.DrawingOptions.PointSidesCount = 5                                       'number of sides
            ct2.DrawingOptions.PointSidesRatio = 0.5                                     'side ratio
            ct2.DrawingOptions.PointSize = 20                                             'point size
            'ct.DrawingOptions.PointRotation = 18                                        'point rotation
            ct2.DrawingOptions.FillVisible = True                                        'show the fill

            Dim ct3 As MapWinGIS.ShapefileCategory
            ct3 = shpf.Categories.Add("V3")
            ct3.Expression = "[REF] = 'V3'"
            ct3.DrawingOptions.PointType = MapWinGIS.tkPointSymbolType.ptSymbolStandard
            ct3.DrawingOptions.PointShape = MapWinGIS.tkPointShapeType.ptShapeFlag

            ct3.DrawingOptions.PointSidesCount = 4                                       'number of sides
            ct3.DrawingOptions.PointSidesRatio = 0.5                                     'side ratio
            ct3.DrawingOptions.PointSize = 20                                             'point size
            ct3.DrawingOptions.PointRotation = 18                                        'point rotation
            ct3.DrawingOptions.FillVisible = True                                        'show the fill

            shpf.Categories.ApplyExpressions()

axMap1.redraw()
Edit :

If I add .DefaultDrawingOptions.Visible = False, nothing appears

The field value of "REF" is correct, I tested it with a label :
.Generate("[REF]", MapWinGIS.tkLabelPositioning.lpCentroid, True)
Dec 23, 2013 at 11:33 AM
Here is the problem, I used single instead of double quotes from a bad sample I found somewhere.
Marked as answer by olivier57 on 12/23/2013 at 3:33 AM
Jan 21, 2014 at 10:42 AM
Hello Oliver,

could you please post the correct code, as I'm not sure which single-quotes you mean and how the code looks like after correction.

Thanks in advance
Jan 21, 2014 at 11:16 AM
Hi,

I used

Public Const cote As String = """"

ct.Expression = "[REF] = " & cote & "V1" & cote