Opened 12 years ago

Closed 12 years ago

#263 closed defect (fixed)

WCPS extendExpr implementation is not correct

Reported by: Dirk Daems Owned by: Peter Baumann
Priority: major Milestone: 8.4
Component: petascope Version: 8.3
Keywords: Cc:
Complexity: Medium

Description

The extendExpr implementation doesn't seem to be correct. According to the WCPS spec there is no restriction on the position and size of the new bounding box; in particular, it does not need to lie outside the coverage; it may intersect with the coverage; it may lie completely inside the coverage; it may not intersect the coverage at all (in which case a coverage completely filled with null values will be generated). But if I try using a bbox that intersects, the query fails. It looks like the translation of WCPS to RASQL is correct, but the RASQL query can't be executed. Indeed, if you look at the definition of the RASQL extend function the domain for extending must, for every boundary element, be at least as large as the MDD's domain boundary. In the following query this is not the case, which causes the error message listed below.

When I use a bbox that is as large as the MDD's domain boundary the following RASQL query is executed, which seems to be correct:
select png(extend(msa,[0:885,0:710])) from mean_summer_airtemp AS msa

But when I use a bbox that is larger than the MDD's domain boundary, the same RASQL query is executed:
select png(extend(msa,[0:885,0:710])) from mean_summer_airtemp AS msa

WCPS query:

for msa in (mean_summer_airtemp)
return encode(
   extend(msa,
          x : "http://www.opengis.net/def/crs/EPSG/0/4326" (120:140),
          y : "http://www.opengis.net/def/crs/EPSG/0/4326" (-40:-10)
          ),
"png")

Error message:

Cause: Error evaluating rasdaman query: 'select png(extend(msa,[160:560,20:620])) from mean_summer_airtemp AS msa
	at petascope.PetascopeInterface.handleProcessCoverages(PetascopeInterface.java:619)
	at petascope.PetascopeInterface.doGet(PetascopeInterface.java:318)
	at petascope.PetascopeInterface.doPost(PetascopeInterface.java:211)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	at java.lang.Thread.run(Thread.java:722)
Caused by: ResourceError: Could not evaluate rasdaman query: 'select png(extend(msa,[160:560,20:620])) from mean_summer_airtemp AS msa'
Cause: Error evaluating rasdaman query: 'select png(extend(msa,[160:560,20:620])) from mean_summer_airtemp AS msa
	at petascope.wcps.server.core.ProcessCoveragesRequest.execute(ProcessCoveragesRequest.java:139)
	at petascope.PetascopeInterface.handleProcessCoverages(PetascopeInterface.java:586)
	... 16 more
Caused by: RasdamanRequestFailed: Error evaluating rasdaman query: 'select png(extend(msa,[160:560,20:620])) from mean_summer_airtemp AS msa
	at petascope.util.ras.RasUtil.executeRasqlQuery(RasUtil.java:118)
	at petascope.wcps.server.core.ProcessCoveragesRequest.execute(ProcessCoveragesRequest.java:137)
	... 17 more
Caused by: org.odmg.QueryException: Execution error 421 in line 1, column 12, near token extend: Target interval of extend operation does not cover MDD to be extended.
	at rasj.odmg.RasOQLQuery.execute(RasOQLQuery.java:249)
	at petascope.util.ras.RasUtil.executeRasqlQuery(RasUtil.java:111)
	... 18 more
DEBUG [09:48:54] PetascopeInterface@430: Done marshalling Error Report.

Change History (4)

comment:1 by abeccati, 12 years ago

Milestone: 8.4
Owner: changed from Dimitar Misev to Peter Baumann
Status: newassigned

comment:2 by Dimitar Misev, 12 years ago

I submitted a patch to remove this limitation in rasql.

I think the limitation was there because the function name is extend, which means grow, and not shrink or intersect the original domain. Perhaps in future we could replace extend() with a more generically named function for changing the domain, e.g. chdom?

comment:3 by Dimitar Misev, 12 years ago

Complexity: Medium

comment:4 by Dimitar Misev, 12 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.