From commits-return-13373-apmail-sis-commits-archive=sis.apache.org@sis.apache.org Mon Mar 16 15:49:40 2020 Return-Path: X-Original-To: apmail-sis-commits-archive@www.apache.org Delivered-To: apmail-sis-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by minotaur.apache.org (Postfix) with SMTP id D1B15193DB for ; Mon, 16 Mar 2020 15:49:39 +0000 (UTC) Received: (qmail 6341 invoked by uid 500); 16 Mar 2020 15:49:39 -0000 Delivered-To: apmail-sis-commits-archive@sis.apache.org Received: (qmail 6313 invoked by uid 500); 16 Mar 2020 15:49:39 -0000 Mailing-List: contact commits-help@sis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: sis-dev@sis.apache.org Delivered-To: mailing list commits@sis.apache.org Received: (qmail 6304 invoked by uid 99); 16 Mar 2020 15:49:39 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Mar 2020 15:49:39 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id EE2178DACC; Mon, 16 Mar 2020 15:49:38 +0000 (UTC) Date: Mon, 16 Mar 2020 15:49:39 +0000 To: "commits@sis.apache.org" Subject: [sis] 01/01: feat(Resample): draft resampling classes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: jsorel@apache.org In-Reply-To: <158437377890.18530.3686020456217581157@gitbox.apache.org> References: <158437377890.18530.3686020456217581157@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: sis X-Git-Refname: refs/heads/feat/resample X-Git-Reftype: branch X-Git-Rev: 66224b2a22b12b4f978db0f66c4ea47040d28785 X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20200316154938.EE2178DACC@gitbox.apache.org> This is an automated email from the ASF dual-hosted git repository. jsorel pushed a commit to branch feat/resample in repository https://gitbox.apache.org/repos/asf/sis.git commit 66224b2a22b12b4f978db0f66c4ea47040d28785 Author: jsorel AuthorDate: Mon Mar 16 16:48:59 2020 +0100 feat(Resample): draft resampling classes --- .../internal/coverage/resample/Interpolator.java | 26 ++++++ .../sis/internal/coverage/resample/Resample.java | 32 +++++++ .../coverage/resample/ResampleBuilder.java | 97 ++++++++++++++++++++++ .../internal/coverage/resample/WarpBuilder.java | 26 ++++++ .../sis/internal/coverage/resample/WarpGrid.java | 26 ++++++ .../internal/coverage/resample/WarpTransform.java | 43 ++++++++++ 6 files changed, 250 insertions(+) diff --git a/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/resample/Interpolator.java b/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/resample/Interpolator.java new file mode 100644 index 0000000..45fa7ab --- /dev/null +++ b/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/resample/Interpolator.java @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.sis.internal.coverage.resample; + +/** + * + * @author Martin Desruisseaux (Geomatys) + * @author Johann Sorel (Geomatys) + */ +interface Interpolator { + +} diff --git a/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/resample/Resample.java b/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/resample/Resample.java new file mode 100644 index 0000000..6924034 --- /dev/null +++ b/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/resample/Resample.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.sis.internal.coverage.resample; + +import org.apache.sis.coverage.grid.GridCoverage; + +/** + * + * @author Martin Desruisseaux (Geomatys) + * @author Johann Sorel (Geomatys) + */ +final class Resample { + + GridCoverage process() { + throw new UnsupportedOperationException("Not implemented"); + } + +} diff --git a/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/resample/ResampleBuilder.java b/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/resample/ResampleBuilder.java new file mode 100644 index 0000000..bc364ed --- /dev/null +++ b/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/resample/ResampleBuilder.java @@ -0,0 +1,97 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.sis.internal.coverage.resample; + +import java.awt.image.RenderedImage; +import java.awt.image.WritableRenderedImage; +import java.util.function.BiFunction; +import org.apache.sis.coverage.grid.GridCoverage; +import org.apache.sis.coverage.grid.GridGeometry; +import org.opengis.referencing.crs.CoordinateReferenceSystem; + +/** + * + * @author Martin Desruisseaux (Geomatys) + * @author Johann Sorel (Geomatys) + */ +public class ResampleBuilder { + + public ResampleBuilder setSource(GridCoverage coverage) { + throw new UnsupportedOperationException("Not implemented"); + } + + public ResampleBuilder setSource(GridGeometry grid, RenderedImage image) { + throw new UnsupportedOperationException("Not implemented"); + } + + public ResampleBuilder setTarget(GridCoverage coverage) { + throw new UnsupportedOperationException("Not implemented"); + } + + public ResampleBuilder setTarget(CoordinateReferenceSystem crs) { + throw new UnsupportedOperationException("Not implemented"); + } + + public ResampleBuilder setTarget(GridGeometry grid) { + throw new UnsupportedOperationException("Not implemented"); + } + + /** + * Resample to target coverage image. + * + * @param grid + * @param image + * @return + */ + public ResampleBuilder setTarget(GridGeometry grid, WritableRenderedImage image) { + throw new UnsupportedOperationException("Not implemented"); + } + + public ResampleBuilder setInterpolation(Interpolator interpolator) { + throw new UnsupportedOperationException("Not implemented"); + } + + /** + * Set target value used to fill samples when source datas are out of coverage extent. + * + * @param fill + * @return + */ + public ResampleBuilder setFillValue(double ... fill) { + throw new UnsupportedOperationException("Not implemented"); + } + + /** + * When resampling multiple coverage onto a single image, how values should be merge + * may depend on the algorithm. + * For example if a value is already defined in the target image and the source + * image provide NaN values we could want to preserve the value in the image instead of the NaN. + * + * By default source samples will override any value in the target image. + * + * @param merger + * @return + */ + public ResampleBuilder setMerger(BiFunction merger) { + throw new UnsupportedOperationException("Not implemented"); + } + + public Resample build() { + throw new UnsupportedOperationException("Not implemented"); + } + +} diff --git a/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/resample/WarpBuilder.java b/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/resample/WarpBuilder.java new file mode 100644 index 0000000..4bd8674 --- /dev/null +++ b/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/resample/WarpBuilder.java @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.sis.internal.coverage.resample; + +/** + * + * @author Martin Desruisseaux (Geomatys) + * @author Johann Sorel (Geomatys) + */ +final class WarpBuilder { + +} diff --git a/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/resample/WarpGrid.java b/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/resample/WarpGrid.java new file mode 100644 index 0000000..63222cc --- /dev/null +++ b/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/resample/WarpGrid.java @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.sis.internal.coverage.resample; + +/** + * + * @author Martin Desruisseaux (Geomatys) + * @author Johann Sorel (Geomatys) + */ +final class WarpGrid { + +} diff --git a/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/resample/WarpTransform.java b/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/resample/WarpTransform.java new file mode 100644 index 0000000..c83942e --- /dev/null +++ b/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/resample/WarpTransform.java @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.sis.internal.coverage.resample; + +import org.apache.sis.referencing.operation.transform.AbstractMathTransform2D; +import org.apache.sis.util.ArgumentChecks; +import org.opengis.referencing.operation.Matrix; +import org.opengis.referencing.operation.TransformException; + +/** + * + * @author Martin Desruisseaux (Geomatys) + * @author Johann Sorel (Geomatys) + */ +final class WarpTransform extends AbstractMathTransform2D { + + private final WarpGrid grid; + + WarpTransform(WarpGrid grid) { + ArgumentChecks.ensureNonNull("grid", grid); + this.grid = grid; + } + + @Override + public Matrix transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, boolean derivate) throws TransformException { + throw new UnsupportedOperationException("Not supported yet."); + } + +}