我是靠谱客的博主 甜美朋友,这篇文章主要介绍arcgis pro sdk 创建要素类图层,现在分享给大家,希望可以做个参考。

接口一:

public Layer CreateLayer( 
   Uri dataUri,
   ILayerContainerEdit mapOrGroupLayer,
   int index,
   string layerName
)

URI参数说明:

A FeatureClass in a FileGeodatabaseC:DataMyFileGDB.gdbCensus
A shape file in a folder\MachineSharedFolderMySpatialData.dbf
A RasterDataset in a FileGeodatabaseC:DataMyFileGDB.gdbDEM
A FeatureClass from a SDEC:ConnectionsMySDEConnection.sdeRoads
An image file in a folder\MachineSharedFolderImagery.tif
A .lyrx or .lpkx file\MachineSharedFolderFires.lyrx
A map service layerhttp://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer
A feature layer off a map or feature servicehttp://sampleserver6.arcgisonline.com/arcgis/rest/services/NapervilleShelters/FeatureServer/0

示例:

var flyrCreatnParam = new FeatureLayerCreationParams(new Uri(@"c:dataworld.gdbcities"))
{
  Name = "World Cities",
  IsVisible = false,
  MinimumScale = 1000000,
  MaximumScale = 5000,
  DefinitionFilter = new CIMDefinitionFilter()
  {
    DefinitionExpression = "Population > 100000",
    Name = "More than 100k"
  },
  RendererDefinition = new SimpleRendererDefinition()
  {
    SymbolTemplate = SymbolFactory.Instance.ConstructPointSymbol(
      CIMColor.CreateRGBColor(255, 0, 0), 8, SimpleMarkerStyle.Hexagon).MakeSymbolReference()
  }
};

var featureLayer = LayerFactory.Instance.CreateLayer<FeatureLayer>(
  flyrCreatnParam, map, LayerPosition.AutoArrange);

接口二:

public FeatureLayer CreateFeatureLayer( 
   FeatureClass featureClass,
   ILayerContainerEdit mapOrGroupLayer,
   int index,
   string layerName,
   RendererDefinition rendererDefinition
)
public FeatureLayer CreateFeatureLayer( 
   Uri dataUri,
   ILayerContainerEdit mapOrGroupLayer,
   int index,
   string layerName,
   RendererDefinition rendererDefinition
)

URI说明:

A FeatureClass in a FileGeodatabaseC:DataMyFileGDB.gdbCensus
A FeatureClass from a SDEC:ConnectionsMySDEConnection.sdeRoads
A shape file in a folder\MachineSharedFolderMySpatialData.dbf
A .lyrx or .lpkx file\MachineSharedFolderFires.lyrx
A feature layer off a map or feature servicehttp://sampleserver6.arcgisonline.com/arcgis/rest/services/NapervilleShelters/FeatureServer/0

最后

以上就是甜美朋友最近收集整理的关于arcgis pro sdk 创建要素类图层的全部内容,更多相关arcgis内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(86)

评论列表共有 0 条评论

立即
投稿
返回
顶部