diff --git a/src/main/java/org/gcube/dataanalysis/geo/utils/VectorTransformations.java b/src/main/java/org/gcube/dataanalysis/geo/utils/VectorTransformations.java index f79b1a0..5e29e9b 100644 --- a/src/main/java/org/gcube/dataanalysis/geo/utils/VectorTransformations.java +++ b/src/main/java/org/gcube/dataanalysis/geo/utils/VectorTransformations.java @@ -1,6 +1,10 @@ package org.gcube.dataanalysis.geo.utils; +import java.util.ArrayList; +import java.util.List; + import org.gcube.contentmanagement.lexicalmatcher.utils.AnalysisLogger; +import org.gcube.dataanalysis.ecoengine.utils.Tuple; import ucar.ma2.ArrayByte; import ucar.ma2.ArrayDouble; @@ -8,46 +12,84 @@ import ucar.ma2.IndexIterator; public class VectorTransformations { - - public static ArrayDouble.D2 arrayByte2DArrayDouble(ArrayByte bytes){ - int[] shapeD = bytes.getShape(); - int yD=shapeD[0]; - int xD=shapeD[1]; - AnalysisLogger.getLogger().debug(xD+"X"+yD+"="+(xD*yD)); - ArrayDouble.D2 doublea = new ArrayDouble.D2(yD,xD); - + public static ArrayDouble.D2 arrayByte2DArrayDouble(ArrayByte bytes) { + int[] shapeD = bytes.getShape(); + int yD = shapeD[0]; + int xD = shapeD[1]; + AnalysisLogger.getLogger().debug(xD + "X" + yD + "=" + (xD * yD)); + ArrayDouble.D2 doublea = new ArrayDouble.D2(yD, xD); + IndexIterator iterator = bytes.getIndexIterator(); - for (int x=0;x