Skip to content

Commit d0b64ba

Browse files
authored
Update README.md
1 parent 91a00aa commit d0b64ba

File tree

1 file changed

+95
-3
lines changed

1 file changed

+95
-3
lines changed

README.md

Lines changed: 95 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,102 @@ An easy way to browse datasets available is the catalog [catalog]((https://cata
6161

6262
## How-to
6363

64+
In this section we give a brief introduction to datacube wrangling. First, terminology: In standardization world, datacubes are modeled by "coverages". Most relevant are the OGC Coverage Implementation Schema (CIS) as the data model and Web Coverage Service (WCS) as the processing model, containing the Web Coverage Processing Service (WCPS) datacube analytics language. So don't be surprised to see "coverages" mentioned below.
65+
66+
We first present a general overview on standards-based datacube access, and then provide some use-case specific examples. If you want to see further examples added, [contact us](mailto:[email protected])!
67+
6468
### General
6569

66-
### Drosophila
70+
#### Coverages
71+
72+
Coverages are designed to be self-describing. While always more metadata can be added to some object, the coverage contains the essentials for understanding the pixels. The canonical structure of a coverage consists of
73+
74+
- domain set: where can I find values?
75+
- range set: the values.
76+
- range type: what do the values mean?
77+
- metadata: what else should I know about these data?
78+
79+
Coverages can be encoded in a variety of data formats. Text formats include XML, JSON, and RDF; binary formats include GeoTIFF, NetCDF, and Grib2.
80+
81+
See [this tutorial](https://earthserver.eu/wcs/#cis) for more details on CIS.
82+
83+
#### Coverage Access
84+
85+
The Web Coverage Service (WCS), in its current version 2.1, defines access in a user-selected encoding, spatio-temporal subsetting, scaling, reprojection, as well as processing (see next section). Such Web requests are expressed as http GET or POST requests as this example (using fairicube rasdaman) shows (whitespace only for an easier read, not part of the request):
86+
87+
'''
88+
https://fairicube.rasdaman.com/rasdaman/ows
89+
? SERVICE=WCS & VERSION=2.1.0 & REQUEST=GetCoverage
90+
& SUBSET=date( "2018-05-22" )
91+
& SUBSET=E( 332796 : 380817 )
92+
& SUBSET=N( 6029000 : 6055000 )
93+
& FORMAT=image/png
94+
'''
95+
96+
As per OGC syntax, date/time strings need to be quoted.
97+
98+
Note that http requires certain characters to be ["URL-encoded"](https://www.urlencoder.io/) before submission; browsers often do that automatically, but not programmatically generated requests.
99+
100+
See [this tutorial](https://earthserver.eu/wcs/#wcs) for more details on WCS.
101+
102+
#### Coverage Processing
103+
104+
WCPS allows processing, aggregation, fusion, and more on datacubes with a high-level, easy-to-use language which does not require any programming skills like python. The following example inspects coverage A and returns a cutout with a range extent expressed in Easting and Northing (assuming this is the native coordinate reference system of the coverage) and a slice at a time point, returned in PNG format:
105+
106+
'''
107+
for $c in ( A )
108+
return
109+
encode( $c [ date( "2018-05-22" ), ( 332796 : 380817 ), N( 6029000 : 6055000 ) ], "png" )
110+
'''
111+
112+
Such a query can be sent through the WCS Processing request:
113+
114+
'''
115+
https://fairicube.rasdaman.com/rasdaman/ows
116+
? SERVICE=WCS & VERSION=2.1.0 & REQUEST=ProcessCoverages
117+
& QUERY=for $c in ( A ) return encode( $c [ date( "2018-05-22" ), ( 332796 : 380817 ), N( 6029000 : 6055000 ) ], "png" )
118+
'''
119+
120+
Again, be reminded that ["http URL-encoding"](https://www.urlencoder.io/) needs to be applied before sending.
121+
122+
So far, each coverage has been processed in isolation. Data fusion is possible through “nested loops”:
123+
124+
'''
125+
for $a in ( A ), $b in ( B )
126+
return encode( $a + $b, "png" )
127+
'''
128+
129+
Aggregation plays an important role for reducing the amount of data transported to the client. With the common aggregation operators – in WCPS called “condensers” – queries like the following are possible (note that no format encoding is needed, numbers are returned in ASCII):
130+
131+
'''
132+
for $a in ( A )
133+
return max( $a )
134+
'''
135+
136+
As a final example, the following WCPS query com¬putes the Inverted Red-Edge Chlorophyll Index (IRECI) on a selected space / time region, performs contrast reduction for visualization, and delivers the result reprojected to EPSG:4326:
137+
138+
'''
139+
for $c in (S2_L2A_32633_B07_60m),
140+
$d in (S2_L2A_32633_B04_60m),
141+
$e in (S2_L2A_32633_B05_60m),
142+
$f in (S2_L2A_32633_B06_60m)
143+
let $sub := [ date("2018-05-22"), E(332796:380817), N(6029000:6055000) ]
144+
return
145+
encode(
146+
crsTransform(
147+
( $c - $d ) / ( $e / $f ) [ $sub ],
148+
{ E: " EPSG:4326", N: “EPSG:4326” }
149+
) / 50,
150+
"png"
151+
)
152+
'''
153+
154+
See [this tutorial](https://earthserver.eu/wcs/#wcps) for more details on WCPS.
155+
156+
### ML Use Case
157+
158+
tbd
67159

68-
[Corresponding data request issue](issues/86)
160+
### Drosophila Use Case
69161

70-
Description of Drosophila cube with sample queries to be added here.
162+
tbd - [Corresponding data request issue](issues/86)

0 commit comments

Comments
 (0)