You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by js...@apache.org on 2020/03/17 07:45:54 UTC

[sis] branch feat/resample updated (66224b2 -> d107907)

This is an automated email from the ASF dual-hosted git repository.

jsorel pushed a change to branch feat/resample
in repository https://gitbox.apache.org/repos/asf/sis.git.


 discard 66224b2  feat(Resample): draft resampling classes
     add b37fde6  Try to produce better identifiers and title for netCDF variables. The identifier excludes the "long_name" attribute, which is sometime more like a sentence than an identifier (the standard name or variable name provides more stable identifiers). Conversely the `metadata.citation.title` uses the "long_name" attribute as first choice, formatted in a way more like English sentence (with '_' and CamelCase replaced by space). Variable names are declared as citation identifier [...]
     add 791558a  Allow DecimalFormat precision to be set even if the CRS is unknown (in which case a generic number format is used).
     new d107907  feat(Resample): draft resampling classes

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (66224b2)
            \
             N -- N -- N   refs/heads/feat/resample (d107907)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../sis/gui/metadata/IdentificationInfo.java       |  30 ++++
 .../org/apache/sis/internal/gui/Resources.java     |   5 +
 .../apache/sis/internal/gui/Resources.properties   |   1 +
 .../sis/internal/gui/Resources_fr.properties       |   1 +
 .../org/apache/sis/geometry/CoordinateFormat.java  |  13 +-
 .../java/org/apache/sis/util/CharSequences.java    | 181 +++++++++++++++++++--
 .../org/apache/sis/util/CharSequencesTest.java     |  26 ++-
 .../apache/sis/internal/netcdf/RasterResource.java |  96 ++++++++---
 .../org/apache/sis/internal/netcdf/Variable.java   |  25 +--
 .../apache/sis/internal/netcdf/impl/GridInfo.java  |   2 +-
 .../sis/internal/netcdf/impl/VariableInfo.java     |   3 +-
 .../apache/sis/storage/netcdf/MetadataReader.java  |   4 +-
 .../sis/internal/storage/AbstractGridResource.java |   4 +-
 .../sis/internal/storage/AbstractResource.java     |  40 ++++-
 .../internal/storage/ConcatenatedFeatureSet.java   |   2 +-
 .../sis/internal/storage/MetadataBuilder.java      |  18 +-
 .../storage/ConcatenatedFeatureSetTest.java        |   5 +-
 17 files changed, 390 insertions(+), 66 deletions(-)


[sis] 01/01: feat(Resample): draft resampling classes

Posted by js...@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 d107907695a2f865234a897df9fa8ab11581a241
Author: jsorel <jo...@geomatys.com>
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<double[], double[], double[]> 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.");
+    }
+
+}