Opened 4 years ago

Closed 4 years ago

#306 closed defect (fixed)

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

Reported by: pcampalani Owned by: pcampalani
Priority: minor Milestone: 8.4
Component: petascope Version: 8.3
Keywords: uom petascope Cc: abeccati


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 Changed 4 years ago by pcampalani

  • Status changed from new to accepted

comment:2 Changed 4 years ago by pcampalani

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

comment:3 Changed 4 years ago by dmisev

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>(
	at petascope.wcps.server.core.EncodeDataExpr.<init>(
	at petascope.wcps.server.core.XmlQuery.startParsing(
	at petascope.wcps.server.core.ProcessCoveragesRequest.<init>(
	at petascope.wcps.server.core.Wcps.pcPrepare(
	at petascope.wcps.server.core.Wcps.pcPrepare(
	at petascope.wcps.server.servlet.WcpsServlet.doPost(
	at javax.servlet.http.HttpServlet.service(
	at javax.servlet.http.HttpServlet.service(
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(
	at org.apache.catalina.core.StandardWrapperValve.invoke(
	at org.apache.catalina.core.StandardContextValve.invoke(
	at org.apache.catalina.core.StandardHostValve.invoke(
	at org.apache.catalina.valves.ErrorReportValve.invoke(
	at org.apache.catalina.valves.AccessLogValve.invoke(
	at org.apache.catalina.core.StandardEngineValve.invoke(
	at org.apache.catalina.connector.CoyoteAdapter.service(
	at org.apache.coyote.http11.Http11Processor.process(
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
	at java.util.concurrent.ThreadPoolExecutor$
Caused by: InvalidRequest: Coverage 'rgb' has invalid metadata
	at petascope.wcps.server.core.CoverageExpr.<init>(
	... 24 more
Caused by: InvalidMetadata: At least one range element is required for coverage rgb
	at petascope.core.Metadata.<init>(
	at petascope.core.Metadata.<init>(
	... 26 more

comment:4 Changed 4 years ago by pcampalani

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 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 Changed 4 years ago by pcampalani

  • Resolution set to fixed
  • Status changed from accepted to closed

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

Note: See TracTickets for help on using tickets.