Arrays of geometries?
Patrick Dowler
pdowler.cadc at gmail.com
Wed Sep 6 00:43:36 CEST 2017
In principle this seems sound because xtype tells you how to interpret
the (array of) primitives into some other structure. But: IIRC, the
wildcard is only allowed in the last dimension in VOTable.
For xtype='timestamp" you could work around that by knowing the length
(precision) of the timestamp(s) you were going to write.... then it
woud be:
<FIELD datatype="char" arraysize="10x*" xtype="timestamp"...>
for a variable length array of date-only timestamps, and maybe
<FIELD datatype="char" arraysize="23x*" xtype="timestamp"...>
for millisecond precision timestamps.
Also, point, circle, and interval arrays could work, but the one you
cannot do is polygon[n] because polygons really do have variable
length.
Pat
On 5 September 2017 at 11:51, Dave Morris <dave.morris at metagrid.co.uk> wrote:
> 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
--
Patrick Dowler
Canadian Astronomy Data Centre
Victoria, BC, Canada
More information about the dal
mailing list