How to create in memory layer and how to visualize these?

494
1
Jump to solution
09-25-2012 07:07 PM
SteffanVoss
New Contributor II
At the moment I am building an add in in C#.

My goal is to use the data of an existing feature layer and to perform some calculations with this data.
That works fine...

Now I want to visualize the new values with a feature renderer like the UniqueValueRenderer.
To achieve this I want to create an in-memory layer, which is a merge of the existing layer and my new data.

I already found the InMemoryWorkspace but the doc says I can not create feature datasets within.

Is there a way to do this on the fly or do I have to copy the old one add my column(s), add it to the TOC and later on use one of therenderer?
0 Kudos
1 Solution

Accepted Solutions
DuncanHornby
MVP Notable Contributor
If I've understood you correctly you have a layer that you have done some calculations on and you want to merge this layer with a second layer into a third "in memory" layer and then display this third layer?

You should be able to do this with an in_memory workspace. When you use the merge tool the output is a FEATURECLASS this is not a FEATURE DATASET which is a sort of "folder" in a geodatabase. As you noted an in_memory workspace cannot support a FEATURE DATASET but it will hold a FEATURECLASS. From this you can write code to create a FeatureLayer and render as you wish then add that to the Map Document (IMap).

Duncan

View solution in original post

0 Kudos
1 Reply
DuncanHornby
MVP Notable Contributor
If I've understood you correctly you have a layer that you have done some calculations on and you want to merge this layer with a second layer into a third "in memory" layer and then display this third layer?

You should be able to do this with an in_memory workspace. When you use the merge tool the output is a FEATURECLASS this is not a FEATURE DATASET which is a sort of "folder" in a geodatabase. As you noted an in_memory workspace cannot support a FEATURE DATASET but it will hold a FEATURECLASS. From this you can write code to create a FeatureLayer and render as you wish then add that to the Map Document (IMap).

Duncan
0 Kudos