Hello,
One of the features for our configuration with ArcGIS Pro is the ability to create joins between our FileGDB (where our FeatureClasses are located) to our custom plugin data source. This allows our users to setup symbology, for example.
One of our users is also trying to setup labeling. In the Label Properties for a feature layer, you can set a SQL statement to filter the IDs, so it only shows labels for the returned IDs.
However, the SQL statement is returning all IDs and therefore all features on the feature layer are labeled.
I can setup a join, through the UI, between a FileGDB and a Shapefile. Or a Shapefile and FileGDB. But setting up a join between a FileGDB and a plugin data source, without using code, doesn't appear possible. I haven't found a way to add in a plugin data source.
Here is the code I am using to create the join.
public static CIMRelQueryTableDataConnection CreateTableJoinDataConnection(string gdbFilePath, string featureDataSet, string sourceTableName, string destinationTable)
{
var identifier = GISApplicationManager.GetInstance().PluginDatasourceName;
var dbase = Directory.GetCurrentDirectory();
CIMRelQueryTableDataConnection retVal = new CIMRelQueryTableDataConnection
{
PrimaryKey = FeatureFieldNames.ElementId,
ForeignKey = FeatureFieldNames.ElementId,
Cardinality = esriRelCardinality.esriRelCardinalityOneToOne,
Name = "GPAddJoin",
JoinType = esriJoinType.esriLeftInnerJoin,
JoinForward = false,
SourceTable = GetTableDataConnection(gdbFilePath, sourceTableName, featureDataSet)
};
CIMStandardDataConnection destination = new CIMStandardDataConnection
{
WorkspaceConnectionString = $"IDENTIFIER={identifier};DATABASE={dbase}",
WorkspaceFactory = WorkspaceFactory.Custom,
CustomWorkspaceFactoryCLSID = "{6AB30075-A4A7-4CEE-A188-20DBB70E74BE}",
Dataset = destinationTable,
DatasetType = esriDatasetType.esriDTTable
};
retVal.DestinationTable = destination;
return retVal;
}
public static CIMFeatureDatasetDataConnection GetTableDataConnection(string gdbFilePath, string sourceTableName, string featureDataSet)
{
return new CIMFeatureDatasetDataConnection
{
FeatureDataset = featureDataSet,
WorkspaceConnectionString = $"DATABASE={gdbFilePath}",
WorkspaceFactory = WorkspaceFactory.FileGDB,
Dataset = sourceTableName,
DatasetType = esriDatasetType.esriDTFeatureClass
};
}
Am I doing something wrong setting up the join? As far as I can tell, and from looking at samples/documentation, the properties are correct.
I am pretty sure the issue is at this level, not where it is being called.
TIA.
Kris
Hi @KrisCulin,
Using the SimplePointPluginTest sample (and associated SimplePointPlugin solution), I was able to successfully join a File Geodatabase to the Plugin data source both as a source and as a target without using any code, just the Pro UI.