• 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;
  • 相关阅读:
    js下数据库 nedb lokijs
    ssh连接docker镜像ubuntu与debian
    Mint wine
    javscript 实现iframe加载内容页出现LOADING效果
    PHP 换行处理
    清风徐来
    php打包下载文件
    Jplayer用法
    js常用方法
    php环境搭建以及优化
  • 原文地址:https://www.cnblogs.com/chinacodegear/p/1423321.html
Copyright © 2020-2023  润新知