Expressing 2- and 3-D coordinates

Doug Tody dtody at nrao.edu
Wed Dec 14 07:12:39 PST 2005


I would argue that expressing an array with an explicit tag for every
array element makes it significantly harder for a computer (or in many
cases even a human) to process the information.  To do so implies that
the values can be given in any order and that the reader must sort out the
sequence to reconstruct the original array.  The tags have to be formally
defined and recognized by the reader to correctly interpret the data; the
reader has to check that all values are present and are not duplicated, etc.
This is quite a lot of work to go to just to reconstruct a simple array.

If we are encoding an array then there is already a conceptual data
model defined somewhere which defines what the elements of the array are.
It is much easier for the software to just pull out and operate upon the
entire array as an atomic object.

Of course, if we start to play tricks and encode complex things into arrays
then it may be better to instead define a structured object with named
elements, but we can already do that.     - Doug


[From Martin:]
> XML has encapsulation to provide association, and ascii tags to provide some
> semantics.  So it can be used to provide useful information about the
> 'specific cases'.
> 
> So the example should be:
>     [...] or
> 
> <ObjectCenter type="Pixel"
>   <X>140</X
>   <Y>69</Y
> </Position
> 
> as appropriate.
> 
> Errors should be associated with the values by encapsulation and
> self-documenting tag(s) where possible, not by position in an associated
> list.
> 
> When you look at this snippet:
> 
> <Position2D
>  <Value2>140 69</Value2
>  <Error2Matrix>0.05 0.0 0.0 0.05</Error2Matrix
> </Position2D
> 
> I'm afraid this does not look clear and it's certainly ambiguous.  Are these
> pixels or polars?  Which way round does the error matrix apply?  It is
> only obvious to someone already familiar with the STC model, not to haplass
> software engineers or researchers who 'just want to use' the document.
> 
> As Paul H has pointed out, the *primary* purpose of XML is for computers
> to read.  Typing the values properly means we can specify contracts
> properly for our interchange documents, and validate them as fully as
> possible.  But as they are also human readable, you have an opportunity
> to make exchange documents that are also relatively self-documented,
> and therefore much easier to understand, use, explain and maintain.



More information about the dm mailing list