I have a scenario where I have to visualize a large set of objects, each of which contains many entities, and those entities come from different sources. For example, I may have EntityCollection1, which contains 10 entities: 4 from CZML, 4 from KML, and 2 manually created entities. EntityCollection2 might have 300 entities, again with mixed sources. The EntityCollections are also dynamically updated via external sources and therefore have to be periodically updated or cleared entirely and re-created.
Is the best way to do something like the following?
- Create and store a new CZMLDataSource and KMLDataSource for every one of my many EntityCollections
- Call load() on each one and retrieve their respective entity collections
- Add the entities from each one of those collections to a single EntityCollection, including any manually created entities
- Add this merged EntityCollection into a master CompositeEntityCollection
Note that once the entities are created, I don't really care where they came from (so there is no logical difference for my situation between those created via KML or CZML or manually once I have my collection created). Therefore, I'd rather not keep them separated by DataSource if I don't have to, I'd prefer they're all merged to a single EntityCollection. I also know that creating many DataSources can be inefficient, so I was hoping to minimize that if possible.