Skip to content
  • Kenneth Moreland's avatar
    Have CoordinateSystem inherit from Field · 9f624f0a
    Kenneth Moreland authored
    Previously, coordinate systems in a DataSet simply pointed to field data
    specifying the coordinate information (although the ability to get that
    back out of the DataSet was missing). This makes sense since point
    coordinates are in fact just fields with a particular semantic meaning
    to them.
    
    However, there is an issue with this approach. It turns out that there
    are special representations that are very common for point coordinates
    and very uncommon for other types of fields. For example, a uniform
    (a.k.a. regular or image) grid has point coordinates that are easily
    derived from the point index, but such fields are quite uncommon
    elsewhere.
    
    Representing this kind of structure in the Field list of a DataSet is
    problematic. Either all fields have to check to see if they are this
    type, which will cause an explosion of unnecessary generated code, or
    you will have to actually write out the coordinates in memory, which is
    really wasteful but what was done previously.
    
    However, by storing fields representing coordinate systems in a separate
    batch, we can use these special types without the stated explosion.
    9f624f0a