Opened 12 years ago

Closed 12 years ago

#306 closed defect (fixed)

UoM ID (and not value) is shown in the WCS rangeType of a coverage

Reported by: Piero Campalani Owned by: Piero Campalani
Priority: minor Milestone: 8.4
Component: petascope Version: 8.3
Keywords: uom petascope Cc: abeccati
Complexity: Medium

Description

Petascope wrongly inserts the ID of a Unit of Measure (UoM) of a coverage, instead of its value, in the WCS rangeType element.
That is, in the following example, the number '1' is in output (which has no semantic meaning of course):

petascopedb=# SELECT id, uom FROM ps_uom WHERE id=1;
 id |  uom  
----+-------
  1 | μg/m3 

Change History (5)

comment:1 by Piero Campalani, 12 years ago

Status: newaccepted

comment:2 by Piero Campalani, 12 years ago

Patch is pending ('UoM (and not UoM database ID) to be shown in the rangeType description (ticket 306#).').

comment:3 by Dimitar Misev, 12 years ago

The patch has been applied, but it seems to be causing troubles. Did the WCPS tests work for you? I'm not sure if it fails because the metadata is wrong or there's a bug in the patch, because I get the same for any coverage:

WcpsError: Coverage 'rgb' has invalid metadata
	at petascope.wcps.server.core.CoverageExpr.<init>(CoverageExpr.java:80)
	at petascope.wcps.server.core.EncodeDataExpr.<init>(EncodeDataExpr.java:77)
	at petascope.wcps.server.core.XmlQuery.startParsing(XmlQuery.java:110)
	at petascope.wcps.server.core.ProcessCoveragesRequest.<init>(ProcessCoveragesRequest.java:96)
	at petascope.wcps.server.core.Wcps.pcPrepare(Wcps.java:120)
	at petascope.wcps.server.core.Wcps.pcPrepare(Wcps.java:114)
	at petascope.wcps.server.servlet.WcpsServlet.doPost(WcpsServlet.java:178)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:203)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:108)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:558)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:379)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:242)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:259)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:237)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:281)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)
Caused by: InvalidRequest: Coverage 'rgb' has invalid metadata
	at petascope.core.DbMetadataSource.read(DbMetadataSource.java:660)
	at petascope.core.DynamicMetadataSource.read(DynamicMetadataSource.java:121)
	at petascope.wcps.server.core.CoverageExpr.<init>(CoverageExpr.java:67)
	... 24 more
Caused by: InvalidMetadata: At least one range element is required for coverage rgb
	at petascope.core.Metadata.<init>(Metadata.java:97)
	at petascope.core.Metadata.<init>(Metadata.java:73)
	at petascope.core.DbMetadataSource.read(DbMetadataSource.java:646)
	... 26 more

comment:4 by Piero Campalani, 12 years ago

hi Dimitar,
I actually added UoMs to the test datasets while I was testing and did not have problems, but you're right, if there is no UoM associated to a coverage band (ps_range row), the results is empty:

SELECT name, type, ps_uom.uom FROM ps_range, ps_uom WHERE ps_range.uom=ps_uom.id AND coverage=10 ORDER by i asc;
 name | type | uom 
------+------+-----
(0 rows)

petascopedb=# SELECT name, type, uom FROM ps_range WHERE coverage=10 ORDER by i asc;
 name | type | uom 
------+------+-----
 0    |    3 |    
 1    |    3 |    
 2    |    3 |    
(3 rows)

My fault, generally UoM might be left empty for dimensionless observations. Fixing it now.

comment:5 by Piero Campalani, 12 years ago

Resolution: fixed
Status: acceptedclosed

Patches accepted: git show --stat 788f5ac 5c266dd.

Note: See TracTickets for help on using tickets.