sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Desruisseaux (Jira)" <j...@apache.org>
Subject [jira] [Commented] (SIS-513) When rounding grids, allow per axis strategy instead of a single global one.
Date Thu, 08 Jul 2021 12:45:00 GMT

    [ https://issues.apache.org/jira/browse/SIS-513?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17377366#comment-17377366
] 

Martin Desruisseaux commented on SIS-513:
-----------------------------------------

The orignal intent of this issue was to avoid {{SubspaceNotSpecifiedException}} inside {{ResampledGridCoverage.render(GridExtent)}}
method when:

* The given {{GridExtent}} has more than 2 dimensions.
* All dimensions except 2 have a size of 1 cell.
* After conversion of this {{GridExtent}} to the source grid coordinate space, the dimensions
of size 1 get a larger size.

It was initially thought that the unexpected size increase was caused by rounding errors.
where coordinates like [0 … 1.000000000001] where rounded to [0 … 2] when using the {{GridRoundingMode.ENCLOSING}}
mode, and that using {{GridRoundingMode.NEAREST}} would fix that issue. However this is not
the case in general: the issue had the _appearance_ of rounding errors because the scale factor
was close to 1. But the scale factor can be anything; if it was 3 instead of 1, no rounding
mode would have allowed the method to work.

A different approach has been implemented in commit [e33d72e|https://github.com/apache/sis/commit/e33d72e5e32f24528f779a94ccd8fca51fb0052e]
by using the Jacobian for detecting which dimensions should have a size of 1, and forcing
the {{GridExtent}} in those dimensions to a size of 1. So the original motivation for this
issue should be fixed.

I will wait a little bit to see if there is other needs for per-axis rounding strategy. If
not, I will close this issue even if the functionality was not implemented as requested.


> When rounding grids, allow per axis strategy instead of a single global one.
> ----------------------------------------------------------------------------
>
>                 Key: SIS-513
>                 URL: https://issues.apache.org/jira/browse/SIS-513
>             Project: Spatial Information Systems
>          Issue Type: Improvement
>            Reporter: Alexís Manin
>            Assignee: Martin Desruisseaux
>            Priority: Major
>
> Related to the usage of `{color:#000000}org.apache.sis.coverage.grid.GridRoundingMode{color}`
:
>  
> At the moment, its usage is often considered as a global configuration for every axes
treated (Example: [GridDerivation.rounding()).|https://sis.apache.org/apidocs/org/apache/sis/coverage/grid/GridDerivation.html#rounding(org.apache.sis.coverage.grid.GridRoundingMode)]
>  
> A possible improvement would be to specify the rounding strategy independently for each
axis of the grid. One possible use-case would be to ease management of 2D resample over 3D+
datasets.
>  
> For example, if the source coverage of a resample defines a grid [ 0..99, 0..99, 0..0
], with the axes being respectively longitude, latitude and time, the pipeline of operation
over the grid could extend all axes, even time slice depending on chosen rounding mode. Such
behavior can fail resampling operation, but would be easily avoidable if we can specify that
time is a special axis to round using NEAREST strategy.
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message