POST
|
I have a grid. I need to display it is classified by DefinedInterval. Method is set to normal, and the interval is calculated by itself. In the description of the method is said that you first need to set the interval and then assign method (?), But how is not clear. code: Public Function ClassifyRenderer1(ByVal rasterDataset As ESRI.ArcGIS.Geodatabase.IRasterDataset, nummeclass As Integer) As IRasterRenderer Try 'Create the classify renderer. Dim classifyRenderer As IRasterClassifyColorRampRenderer = New RasterClassifyColorRampRendererClass() classifyRenderer.ClassCount = nummeclass Dim rasterRenderer As IRasterRenderer = CType(classifyRenderer, IRasterRenderer) 'Set up the renderer properties. Dim raster As IRaster = rasterDataset.CreateDefaultRaster() rasterRenderer.Raster = raster Dim pRasterBC As IRasterBandCollection = CType(rasterRenderer.Raster, IRasterBandCollection) Dim pRasterBand As IRasterBand = pRasterBC.Item(0) pRasterBand.ComputeStatsAndHist() classifyRenderer.ClassCount = nummeclass rasterRenderer.Update() 'set classfication method Dim pClassProp As IRasterClassifyUIProperties pClassProp = classifyRenderer Dim pUID As UID Dim ClassBreak As Object Dim pClassify As IClassifyGEN pClassify = New DefinedInterval Dim pInterval As IIntervalRange2 = pClassify pInterval.IntervalRange = 25 ClassBreak = pClassify.ClassBreaks pUID = pClassify.ClassID pClassProp.ClassificationMethod = pUID rasterRenderer = classifyRenderer rasterRenderer.Update() 'Set the color ramp for the symbology. Dim colorRamp As IAlgorithmicColorRamp = New AlgorithmicColorRampClass Dim startColor As IRgbColor Dim endColor As IRgbColor startColor = New RgbColor endColor = New RgbColor startColor.Red = 209 startColor.Green = 144 startColor.Blue = 21 endColor.Red = 7 endColor.Green = 218 endColor.Blue = 7 'Set the Start and End 'Colorsalg() colorRamp.ToColor = startColor 'alg() colorRamp.FromColor = endColor 'Set the ramping Alglorithm alg colorRamp.Algorithm = esriColorRampAlgorithm.esriCIELabAlgorithm 'Set the size of the ramp (the number of colors to be derived)alg colorRamp.Size = nummeclass 'Create the rampalg colorRamp.CreateRamp(True) ' Dim createColorRamp As Boolean 'colorRamp.CreateRamp(createColorRamp) 'Create the symbol for the classes. Dim fillSymbol As IFillSymbol = New SimpleFillSymbolClass() Dim pFSymbol As IFillSymbol pFSymbol = New SimpleFillSymbol Dim i As Integer For i = 0 To classifyRenderer.ClassCount - 1 Step i + 1 pFSymbol.Color = colorRamp.Color(i) classifyRenderer.Symbol(i) = CType(pFSymbol, ISymbol) ' classifyRenderer.Label(i) = Convert.ToString(i) Next Return rasterRenderer Catch ex As Exception System.Diagnostics.Debug.WriteLine(ex.Message) Return Nothing End Try End Function
... View more
11-19-2012
07:09 PM
|
0
|
0
|
1665
|
POST
|
How to make the inclusion of hyperlinks to vb.net Layer Properties-> Display Tab->hyperlinks result [ATTACH=CONFIG]13869[/ATTACH] Sub add_hyper(i As Integer) Dim pDoc As IMxDocument pDoc = My.ArcMap.Application.Document Dim pMap As IMap pMap = pDoc.FocusMap Dim pFeatureLayer As ESRI.ArcGIS.Carto.IFeatureLayer Dim pFeatLayer As IFeatureLayer pFeatLayer = pMap.Layer(i) pFeatureLayer = pFeatLayer Dim pHotLinkContainer As IHotlinkContainer pHotLinkContainer = pFeatureLayer pHotLinkContainer.HotlinkType = ESRI.ArcGIS.Carto.esriHyperlinkType.esriHyperlinkTypeDocument pHotLinkContainer.HotlinkField = "PRAZREZ" end sub
... View more
04-26-2012
11:24 PM
|
0
|
0
|
390
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|