Opened 11 years ago
Closed 11 years ago
#631 closed defect (fixed)
Duplicate code for coordinates to grid indexes conversion
Reported by: | Piero Campalani | Owned by: | Piero Campalani |
---|---|---|---|
Priority: | major | Milestone: | 9.0 |
Component: | petascope | Version: | development |
Keywords: | conversion duplicate grid indexes | Cc: | |
Complexity: | Medium |
Description
Petascope has duplicate code used to convert domain coordinates to grid indexes:
convertToPixelIndices()
inpetascope.wcps.server.core.Crs
(WCPS conversion)toPixels()
inpetascope.wcs2.extensions.AbstractFormatExtension
(WCS tool to update GetCoverage metadata, see changeset:333ebf9)
The latter method is also working only with subsets on numeric regular grid axes, which is not the case anymore.
A unique utility method should be created (CrsUtil probably is the best location). Since conversions can be called more than once within a single query, conversions would be better cached not to re-compute conversions.
Change History (2)
comment:1 by , 11 years ago
Status: | new → accepted |
---|
comment:2 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
Note:
See TracTickets
for help on using tickets.
Fixed in changeset:136a807 : conversion method refactored to the static
CrsUtil
class. Now both WCPSDimensionPointElement
/DimensionIntervalElement
classes and WCS 2.0AbstractFormatExtension
class use the same conversion method. Conversions (key = {coverage name, axis name, low and high bounds}) are cached.