Export (for a grid) can be done as follows:

GdalFileExporter.ExportTo(string path,IFunction source)
{
   //get store for given path. The store should be ready to get values from the target
   IFunctionStore targetStore = GetStoreForPath(path);
   //clone to should take care of set values in the file.
   source.CloneTo(targetStore);

}

In IFunction we should add a CloneTo method that creates a clone using the given store. The Clone() method uses the memory store. The CloneTo method is the hard part since there we should time the SetValues call after the store is set.

  • No labels

2 Comments

  1. 1. I prefer to name the method CloneTo -> CopyTo

    2. How are we going to handle function stores that are not file based?

    1. Unknown User (don)

      1. We've added it as an overload for now:

      IFunction Clone(IFunctionStore targetStore);

      2. Not file-based store called MemoryFunctionStore (don't think we need more of them) will just have all variable values copied. Or maybe better to implement it as a clone of the store itself.