ThinkGeo.com    |     Documentation    |     Premium Support

Wiki on adding InMemoryFeatureLayer Columns is confusing

Twice in the Wiki, the remarks say “You should set the column names for the data that the InternalFeatures will hold. For example, if you have some features that represent road signs, then one column you may want to add is ‘Sign Type’. Then, for every Feature you add to the layer, you need to add the ‘Sign Type’ and a value to the InternalFeatures’ ColumnValues dictionary.” Every example I have found in the forum always involves creating a new Layer, adding the desired column, and adding a single feature. Please clarify the last sentence of that quote:

  1. Does the column have to be added every time I access the Layer or only once, when it is created?
  2. What happens if another identical FeatureSourceColumn is added later?

Also, when adding features to the Layer, am I correct in believing that if the added feature has the same key as an existing feature, the existing one is replaced by the new one?

Hi JWhitmire,

  1. The column only need to be added when the layer is created.
  2. Another column added is OK, that just like you append one column
  3. I think you don’t need to worry about the same key problem, directly add the feature into layer is OK. If you want to use new feature replace old one, you need “update” it or “remove and add”.

Regards,

Don