zoukankan      html  css  js  c++  java
  • Delphi ArcEngine 创建梯度专题 Proportional

    function ProportionalSymbolRenderer(pLayer: ILayer; sField: string; pFrontColor, pBackColor: IColor;

    iLegendCount:  Integer): Boolean;

    //参数依次为 图形,该图层的某一个字段名称,前景色,背景色,图例分级数量

    var
      pGeoLayer: IGeoFeatureLayer;
      pTable: ITable;
      iFieldIndex: Integer;
      pRenderer: IProportionalSymbolRenderer;

      pQueryFilter: IQueryFilter;
      pCursor: ICursor;
      pRow: IRow;
      pColor: IColor;

      pDataStatics: IDataStatistics;
      pStaticsResults: IStatisticsResults;

      pFillSymbol: ISimpleFillSymbol;
      pMarkerSymbol: ISimpleMarkerSymbol;
      pSymbol: ISymbol;
      sValue: string;

    begin
      pGeoLayer := pLayer as IGeoFeatureLayer;
      pTable := pLayer as ITable;
      pRenderer := CoProportionalSymbolRenderer.Create as IProportionalSymbolRenderer;

      pQueryFilter := CoQueryFilter.Create as IQueryFilter;
      pQueryFilter.AddField(sField);
      pCursor := pTable.Search(pQueryFilter, True);

      pDataStatics := CoDataStatistics.Create as IDataStatistics;
      pDataStatics.Cursor := pCursor;
      pDataStatics.Field := sField;
      pStaticsResults := pDataStatics.Statistics;

      //创建符号
      pFillSymbol := CoSimpleFillSymbol.Create as ISimpleFillSymbol;
      pFillSymbol.Color := pBackColor;

      pMarkerSymbol := CoSimpleMarkerSymbol.Create as ISimpleMarkerSymbol;
      pMarkerSymbol.Color := pFrontColor;
      pMarkerSymbol.Size := 3;
      pMarkerSymbol.Style := esriSMSDiamond;

      pRenderer.ValueUnit := esriUnknownUnits;
      pRenderer.Field := sField;
      pRenderer.MinDataValue := pStaticsResults.Minimum;
      pRenderer.MaxDataValue := pStaticsResults.Maximum;
      pRenderer.BackgroundSymbol := pFillSymbol;
      pRenderer.MinSymbol := pMarkerSymbol as ISymbol;
      pRenderer.LegendSymbolCount:=  iLegendCount;
      pRenderer.CreateLegendSymbols;

      pGeoLayer.Renderer := pRenderer  as IFeatureRenderer;

      Result := True;

    end;
  • 相关阅读:
    hdu 4786 Fibonacci Tree
    Sae 上传文件到Storage
    Java通过代理server上网
    iOS 利用Socket UDP协议广播机制的实现
    android_handler(三)
    shell 脚本执行日志通用模块
    adt-bundle-linux-x86_64-20131030下新建project提示找不到adb和R.java问题的解决
    【MongoDB】The Access control of mongodb
    Java——设计模式(装饰模式_IO)
    动态顺序表
  • 原文地址:https://www.cnblogs.com/chinacodegear/p/1423321.html
Copyright © 2011-2022 走看看