Arrays of geometries?
Dave Morris
dave.morris at metagrid.co.uk
Tue Sep 5 20:51:07 CEST 2017
Hiya,
Yep, I agree with this.
Just to be clear, an array of four POINT(s)
POINT[4]
is serialized as
<FIELD datatype="float" arraysize="2x4" xtype="point"...>
More generally, if the serialization for an xtype is defined as an array
of primitives (characters or floats etc), then an array of xtype values
is serialized as a multi-dimensional array of the same primitives where
the first dimension is the number of primitives required for an instance
of the xtype and subsequent dimensions describe the dimensions of the
array of xtype values.
So if the serialization for mytype is an array of M integers
<FIELD datatype="int" arraysize="M" xtype="mytype"...>
then an array of N mytypes
mytype[N]
would be serialized as
<FIELD datatype="int arraysize="MxN" xtype="mytype"...>
Seems to work ok.
The only edge case I can see is that DALI allows the serialization of
TIMESTAMP as char[*]
<FIELD datatype="char" arraysize="*" xtype="TIMESTAMP"...>
So an array of four TIMESTAMPs would have a wildcard, '*' as the first
array dimension.
<FIELD datatype="char" arraysize="*x4" xtype="TIMESTAMP"...>
Which is equivalent to an array of variable length Strings.
I'm happy with that, but it might raise a few questions.
-- Dave
--------
Dave Morris
Research Software Engineer
Wide Field Astronomy Unit
Institute for Astronomy
University of Edinburgh
--------
On 2017-09-05 12:24, Markus Demleitner wrote:
> Dear DAL,
>
> While implementing DALI 1.1 with a view to TAP 1.1, one of my test
> cases lead to the encoding of a 2-array of points to a
>
> <FIELD datatype="float" arraysize="2x2" xtype="point"...>
>
> This made me realise that, as far as I can see, it's unclear what
> that means by DALI. And it leads to the more fundamental question of
> whether xtype amends the datatype -- which would support such usage
> -- or whether it amends (datatype, arraysize) -- which probably would
> outlaw things like these.
>
> So:
>
> Is anyone strongly in favour of such usage? Note that another,
> perhaps more common, use case is arrays of timestamps, which *could*
> play a role in certain time series serialisations?
>
> ...or is anyone strongly opposed to it?
>
> Either way, I think it's one of these corner cases where we should
> somehow agree upon a policy. Should xtype+array be allowed?
> Forbidden? Undefined at this point?
>
> -- markus
More information about the dal
mailing list