Opened 11 years ago
Closed 8 years ago
#667 closed task (fixed)
Utility to associated a custom SWE data component to coverages
Reported by: | Piero Campalani | Owned by: | Dimitar Misev |
---|---|---|---|
Priority: | major | Milestone: | 9.3 |
Component: | petascope | Version: | development |
Keywords: | swe creation script | Cc: | Dimitar Misev |
Complexity: | Medium |
Description
While the Petascope partly supports SWE data components, there is still no user-friendly way (other than manual SQL inserts) to generate a custom SWE for the range type description of a coverage.
A simple shell script can/should be created to support users on the creation of such metadata.
Change History (12)
comment:1 by , 11 years ago
follow-up: 11 comment:2 by , 11 years ago
I mean: now a user who wants to associate a custom SWE quantity to a coverage (rasimport does not provide params for this, e.g. UoM, NIL values and reasons, custom allowed intervals…), needs to manually INSERT/UPDATE the database.
I am talking about a script/tool that lets you set this thing for a coverage without interventions on the db.
Otoh, Petascope can already interpret custom SWE fields (see our eobstest coverage import function).
comment:3 by , 11 years ago
But this is the case for any other petascope metadata, not just SWE. It would be better to implement support for the SWE metadata in rasimport, rather than creating new scripts.
comment:4 by , 11 years ago
Which other metadata do you mean?
I just proposed the bash-way now as a quicker solution: ideally rasgeo would need it, I agree, but Alex has worked already much on rasgeo lately, so we probably need somebody else for it.
comment:5 by , 10 years ago
Cc: | added |
---|
Can you point to the petascopedb documentation for the SWE? Then Bidesh could implement support for it in rasimport.
comment:6 by , 10 years ago
SWE common data model:
- http://www.opengeospatial.org/standards/swecommon
- http://portal.opengeospatial.org/files/?artifact_id=41157
petascopedb:
- wiki:PetascopeDevGuide#Petascopedatabaseschema:petascopedb
- Feature space (range type) section of wiki:PetascopeDevGuide#Tablesandfields
- UML diagrams in browser:PetascopeDevGuide attachments
examples:
- see functions import_eobs(), import_irr_cube_2() in browser:systemtest/util/petascope.sh
- From http://earthserver.eu/trac/wiki/UseCase_EOX_SnowMapSeries (access required):
[...] # # SWE quantity # (queries valid for PostgreSQL >= 9.1) # # UoM $PSQL -c "INSERT INTO ps_uom (code) SELECT '${c_swe_uom_code}' WHERE NOT EXISTS (SELECT id FROM ps_uom WHERE code='${c_swe_uom_code}')" uom_id=$( $PSQL -P t -P format=unaligned -c "SELECT id FROM ps_uom WHERE code='${c_swe_uom_code}'" ) # NIL value $PSQL -c "INSERT INTO ps_nil_value (value, reason) SELECT '${c_swe_nil_value}', '${c_swe_nil_reason}' WHERE NOT EXISTS (SELECT id FROM ps_nil_value WHERE value='${c_swe_nil_value}' AND reason='${c_swe_nil_reason}')" nil_id=$( $PSQL -P t -P format=unaligned -c "SELECT id FROM ps_nil_value WHERE value='${c_swe_nil_value}' AND reason='${c_swe_nil_reason}'" ) # data record $PSQL -c "INSERT INTO ps_quantity (uom_id, label, description, definition_uri, nil_ids) SELECT ${uom_id}, '${c_swe_label}', '${c_swe_description}', '${c_swe_definition_uri}', ARRAY[${nil_id}] WHERE NOT EXISTS (SELECT id FROM ps_quantity WHERE uom_id=${uom_id} AND label='${c_swe_label}' AND description='${c_swe_description}')" quantity_id=$( $PSQL -P t -P format=unaligned -c "SELECT id FROM ps_quantity WHERE uom_id='${uom_id}' AND label='${c_swe_label}' AND description='${c_swe_description}'" ) # allowed values interval_id=$( $PSQL -P t -P format=unaligned -c "SELECT id FROM ps_interval WHERE min='${c_swe_min}' AND max='${c_swe_max}'" ) $PSQL -c "INSERT INTO ps_quantity_interval (quantity_id, interval_id) SELECT ${quantity_id}, ${interval_id} WHERE NOT EXISTS (SELECT * FROM ps_quantity_interval WHERE quantity_id=${quantity_id} AND interval_id=${interval_id})" # link quantity to cryo coverage coverage_id=$( $PSQL -P t -P format=unaligned -c "SELECT id FROM ps_coverage WHERE name='${cov_name}'" ) $PSQL -c "UPDATE ps_range_type_component SET field_id='${quantity_id}' WHERE coverage_id=${coverage_id}"
Support is needed for changing Quantity UoM, Quantity label and description, Quantity definition URI, Quantity allowed intervals and nil values (the significant figures are there but still not used by Petascope)(see also browser:applications/petascope/src/main/db/petascope/update8/schema.sql)
comment:7 by , 10 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Thanks, reassigning to Bidesh but it's a low priority ticket for now.
comment:8 by , 10 years ago
Milestone: | 9.1 → 10.0 |
---|
comment:9 by , 9 years ago
Owner: | changed from | to
---|
comment:10 by , 8 years ago
Cc: | removed |
---|---|
Milestone: | 10.0 → 9.3 |
Owner: | changed from | to
I will look at this ticket soon.
comment:11 by , 8 years ago
Cc: | added |
---|---|
Owner: | changed from | to
I think wcst_import support these parameters (UoM, NIL,…) and it can display with DescribeCoverage.
@dmisev: should you consider close this ticket?
Replying to pcampalani:
I mean: now a user who wants to associate a custom SWE quantity to a coverage (rasimport does not provide params for this, e.g. UoM, NIL values and reasons, custom allowed intervals…), needs to manually INSERT/UPDATE the database.
I am talking about a script/tool that lets you set this thing for a coverage without interventions on the db.
Otoh, Petascope can already interpret custom SWE fields (see our eobstest coverage import function).
comment:12 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I think can close ticket as it is supported in wcst_import.
You mean this can be automatically derived from the existing tables in petascope? Why can't we do it in the petascope code in that case?