Changes between Version 24 and Version 25 of PetascopeUserGuide


Ignore:
Timestamp:
Feb 13, 2013 6:22:39 PM (4 years ago)
Author:
pcampalani
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PetascopeUserGuide

    v24 v25  
    2222Petascope supports WCS 2.0; see [http://kahlua.eecs.jacobs-university.de/~earthlook/demos/wcs2/index.php this demo].
    2323
    24 === gmlcov:metadata ===
     24=== Metadata ===
     25==== gmlcov:metadata ====
    2526
    26 Additional arbitrary metadata for a coverage `"coverageName"` can be manually injected into the output of a ''!DescribeCoverage'' response by properly filling the `petascopedb:ps_metadata` table:
     27Additional arbitrary metadata for a coverage `"myCoverage"` can be manually injected into the output of a ''!DescribeCoverage'' response by properly filling the `petascopedb:ps_metadata` table:
    2728{{{
    2829#!sql
    29 INSERT INTO ps_metadata (coverage, metadata) VALUES ((SELECT id FROM ps_coverage WHERE name='coverageName'), 'myMetadata');
     30INSERT INTO ps_metadata (coverage, metadata) VALUES ((SELECT id FROM ps_coverage WHERE name='myCoverage'), 'myMetadata');
    3031}}}
    3132
     
    4243Recommended use is to use the XML extension mechanism, such as in a WCS extension or Application Profile, to define the desired metadata structure.
    4344}}}
     45
     46==== Feature space description ====
     47
     48Metadata regarding the data types of the feature space for a coverage `"myCoverage"` can also be injected in the ''!DescribeCoverage'' response.
     49Name, type and UoM of each band can be set by proper filling of the `petascopedb` tables `ps_range` and `ps_uom`.
     50
     51For instance, if we want to publish that `"myCoverage"` has 1 band of `[0,255]` integer values (uchar) which represent mass concentrations (μg/m^3):
     52
     53{{{
     54#!sql
     55petascopedb=# INSERT INTO ps_uom (uom) VALUES ('μg/m3') RETURNING id;
     56INSERT 0 1
     57petascopedb=# INSERT INTO ps_range (coverage, i, name, type, uom) VALUES (
     58petascopedb-#    (SELECT id FROM ps_coverage WHERE name='myCoverage'),        -- coverage
     59petascopedb-#    0,                                                           -- i
     60petascopedb-#    'PM10 mass concentrations',                                  -- name
     61petascopedb-#    (SELECT id FROM ps_datatype WHERE datatype='unsigned char'), -- type
     62petascopedb-#    (SELECT id FROM ps_uom WHERE uom='μg/m3'));                  -- uom
     63}}}
     64
     65..and similarly for updating.
     66The `i` represents the order of the bands (starting from 0).
     67The `type` is to be set by pointing to the proper row in `ps_datatype` (see [http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html this link] for details): 
     68{{{
     69#!sql
     70petascopedb=# SELECT * FROM ps_datatype ORDER BY datatype;
     71 id |    datatype   
     72----+----------------
     73  1 | boolean         
     74  2 | char
     75 12 | complex         
     76 13 | complex2
     77 11 | double
     78 10 | float
     79  6 | int
     80  8 | long
     81  4 | short
     82  3 | unsigned char
     83  7 | unsigned int
     84  9 | unsigned long
     85  5 | unsigned short
     86(13 rows)
     87}}}
     88
     89To verify the inserted metadata, you can execute:
     90
     91{{{
     92#!sql
     93petascopedb=# SELECT ps_coverage.name AS coverage, i, ps_range.name AS band, ps_datatype.datatype, ps_uom.uom
     94petascopedb-# FROM ps_coverage, ps_range, ps_datatype, ps_uom
     95petascopedb-# WHERE ps_coverage.id=ps_range.coverage
     96petascopedb-#   AND ps_datatype.id=ps_range.type
     97petascopedb-#   AND ps_uom.id=ps_range.uom
     98petascopedb-#   AND ps_coverage.name='myCoverage';
     99  coverage  | i |           band           |   datatype    |  uom 
     100------------+---+--------------------------+---------------+-------
     101 myCoverage | 0 | PM10 mass concentrations | unsigned char | μg/m3
     102(1 row)
     103}}}
     104
     105After doing so, a ''!DescribeCoverage'' response will then report the inserted metadata:
     106{{{
     107#!xml
     108<gmlcov:rangeType>
     109  <swe:DataRecord>
     110    <swe:field name="PM10 mass concentrations">
     111      <swe:Quantity definition="urn:ogc:def:dataType:OGC:1.1:unsigned char">
     112        <swe:description/>
     113        <swe:uom code="μg/m3"/>
     114        <swe:constraint>
     115          <swe:AllowedValues>
     116            <swe:interval>0 255</swe:interval>
     117          </swe:AllowedValues>
     118        </swe:constraint>
     119      </swe:Quantity>
     120    </swe:field>
     121  </swe:DataRecord>
     122</gmlcov:rangeType>
     123}}}
     124
     125[[span(NOTE1: ''Petascope'' requires at least 1 row in `ps_range` per coverage., style=color: Black; font-size: 80%)]][[BR]]
     126[[span(NOTE2: `ps_range` is automatically filled if the coverage is ingested via `rasimport` utility., style=color: Black; font-size: 80%)]]
    44127
    45128== WCPS ==