Duplicate code for coordinates to grid indexes conversion
|Reported by:||pcampalani||Owned by:||pcampalani|
|Keywords:||conversion duplicate grid indexes||Cc:|
Petascope has duplicate code used to convert domain coordinates to grid indexes:
- convertToPixelIndices() in petascope.wcps.server.core.Crs (WCPS conversion)
- toPixels() in petascope.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.