Definition Expressions across layers - Table Joins

541
2
12-03-2019 06:56 AM
DwayneKuykendall
New Contributor II

We have spent quite a bit of effort converting our ArcEngine applications to .Net Runtime.  On of the greatest challenges is working with related data.  I have opened a few tickets with ESRI regarding this in the past, but have been presented with no solutions.

For clarity, we work almost exclusively offline using replicas.

Our challenge:  Join the attributes of two tables so the resulting table can be used in a definition expression to filter child layers on the map.

The problem:  We frequently work with map layers that are related.  In general, there is a "Parent" layer.  Other layers are related to the parent.  There are many cases where we need to show a subset of the parents an only the child layer data that is related to this subset.  For example, suppose the map consisted of a parent layer, US "States" and one child layer containing State "Parks".  If the States layer has a "Population" attribute, we may want to set a definition expression on the "States" layer and also filter the "Parks" layer to the resulting States.

We were presented with a solution from ESRI that requires querying the States layer for the required parent results.  Then we iterating through each result executing  "QueryRelatedFeaturesAsync" to get the child features and add each child feature to a feature collection.  Needless to say, this is EXTREMELY SLOW.

Surely there's a better way.

Any suggestions are welcome.  We remain hopeful that the .Net Runtime will mature into a product that truly does embrace related data.

Thanks,

0 Kudos
2 Replies
JoeHershman
MVP Regular Contributor

Just kicking the tires with this one.  Perhaps you could use Sqlite API directly to query the parent layers, build out the definition expression and then apply to the layer.

Thanks,
-Joe
0 Kudos
DwayneKuykendall
New Contributor II

We do most of our reading of data through the SQLite API directly.  It's much faster and we can create the joins as needed.

Since it isn't possible to join the layers, we cannot create a definition expression using fields from another table.  Thus the need for the join. 

If the layer tables were joined, many things would be possible.

0 Kudos