DAP4: Subsetting Arrays and Grids By Value: Difference between revisions

From OPeNDAP Documentation
⧼opendap2-jumptonavigation⧽
No edit summary
No edit summary
Line 49: Line 49:
</source></font>
</source></font>


Applying the constraint "?sal<3.2" would return this:
Applying the constraint "<font size=2><code>?sal<3.2</code></font>" would return this:


<font size="2"><source lang="xml">
<font size="2"><source lang="xml">

Revision as of 13:24, 28 April 2012

<-- back to OPULS Development

ndp

Background

DAP2 did not support sub-setting of Arrays and Grids using relational operators. Many of our support questions over the years have been from frustrated users who were attempting to perform relational sub-setting on these objects and couldn't understand why it wasn't working.


Problem addressed

Will Allow users to subset Arrays (and "Grids") using relational operators.

Proposed solution

Allow users to apply relational constraints to the values of Arrays (and "Grids"). The server should return a Sequence of Structures each of which holding a matching Array value, along with the values of all of the associated dimensions.

For example, let's consider this data object:

<Dimension name="x" size="1024"/>
<Dimension name="y" size="1024"/>
<Dimension name="z" size="12"/>

<!-- The dimensions of a Coordinate MUST be SharedDimensions -->
<Map name="lon" type="Float32">
    <dimension ref="x"/>
    <dimension ref="y"/>
</Map>

<Map name="lat" type="Float32">
    <dimension ref="x"/>
    <dimension ref="y"/>
</Map>

<Map name="depth" type="Float32">
    <Attribute name="unit" type="String"><value>meters</value></Attribute>
    <dimension ref="x"/>
    <dimension ref="y"/>
    <dimension ref="z"/>
</Map>

<Float64 name="sal">
    <dimension ref="x"/>
    <dimension ref="x"/>
    <dimension ref="z"/>
    <map name="lat" />
    <map name="lon" />
    <map name="depth" />
</Float64>

Applying the constraint "?sal<3.2" would return this:

<Sequence name="sal">
    <Float64 name="sal" />
    <Float32 name="lat"/>
    <Float32 name="lon"/>
    <Float32 name="depth"/>
</Sequence>


Rationale for the solution

Subsetting arrays and "grids" using relational expressions is unlikely to yield a set of matching items that can still be viewed as the same object in the data model. By representing the result as a Sequence we are able to return a reasonable representation of the result of the applied constraint using another representation found in the data model.

Discussion