Feature Layer - Class Break Renderer - Join To Table

2839
2
Jump to solution
07-31-2015 03:16 AM
JonDicken
New Contributor II

Hi,

Is it possible to join a Feature Layer to an in memory table or graphics layer in code and use the attributes from the resulting join for thematically styling the Feature Layer using a class break renderer for example?

This would allow a user to bring their own local data in and have it used to style an existing Feature Layer using new attributes.

So the steps would be:

- Existing Feature Layer

- User selects a local database file and imports the data in to a new table or layer

- Join the new table or layer to the existing Feature Layer

- Create renderer for the Feature Layer based on attributes from the new table or layer

Regards,

0 Kudos
1 Solution

Accepted Solutions
AnttiKajanus1
Regular Contributor II

You need to use GraphicsOverlay or GraphicsLayer and use that to contains joined data. The reason behind is that FeatureLayers uses defined Schema where GraphicsOverlay/Layer works with dynamic schema.

Steps could be something like this:

- Create source FeatureLayer with FeatureTable

- User selects geodatabase and open that in GeodatabaseFeatureTable

- Create temporary graphics overlay / layer for visualization

- Join needed data from source FeatureLayer (tip, convert features to graphics) to the dynamically created GeodatabaseFeatureTable to GraphicsCollection / List<Graphic>

- Set combined list of graphics to the temporary visualization layer

- Dynamically create renderer for the temporary visualization layer

This approach also gives you an option to delete the layer/overlay when it's not needed anymore easily.

View solution in original post

0 Kudos
2 Replies
AnttiKajanus1
Regular Contributor II

You need to use GraphicsOverlay or GraphicsLayer and use that to contains joined data. The reason behind is that FeatureLayers uses defined Schema where GraphicsOverlay/Layer works with dynamic schema.

Steps could be something like this:

- Create source FeatureLayer with FeatureTable

- User selects geodatabase and open that in GeodatabaseFeatureTable

- Create temporary graphics overlay / layer for visualization

- Join needed data from source FeatureLayer (tip, convert features to graphics) to the dynamically created GeodatabaseFeatureTable to GraphicsCollection / List<Graphic>

- Set combined list of graphics to the temporary visualization layer

- Dynamically create renderer for the temporary visualization layer

This approach also gives you an option to delete the layer/overlay when it's not needed anymore easily.

View solution in original post

0 Kudos
JonDicken
New Contributor II

Okay, thanks. That's a bit of a shame. I can see that would work nicely for smaller layers but with much larger Feature Layers it doesn't sound great as you would end up with a huge graphics layer, which is not recommended/really an option. The beauty of the Feature Layer is that it doesn't load all of the features in to memory at the same time.

Perhaps the real request is therefore not to alter the Feature Layers schema (by joining) but just have the renderer use a 'lookup' in order to get its values. That way you could just point a Feature Layer at a separate list of <Feature ID, Value>s and have the renderer take the value for each Feature from there.