Revision: 6439
          http://sourceforge.net/p/jump-pilot/code/6439
Author:   ma15569
Date:     2020-09-11 11:22:05 +0000 (Fri, 11 Sep 2020)
Log Message:
-----------
added method to preserve compatibility with OpenKLEM vectorialize

Modified Paths:
--------------
    
core/trunk/src/org/openjump/core/rasterimage/algorithms/VectorizeAlgorithm.java

Modified: 
core/trunk/src/org/openjump/core/rasterimage/algorithms/VectorizeAlgorithm.java
===================================================================
--- 
core/trunk/src/org/openjump/core/rasterimage/algorithms/VectorizeAlgorithm.java 
    2020-09-10 06:32:20 UTC (rev 6438)
+++ 
core/trunk/src/org/openjump/core/rasterimage/algorithms/VectorizeAlgorithm.java 
    2020-09-11 11:22:05 UTC (rev 6439)
@@ -1034,4 +1034,28 @@
 
     }
 
+    /** Create a FeatureCollection of polygons defining a 
GridWrapperNotInterpolated and number of band
+     * Sextante algorithm - compatible with OpenKLEM methods
+     * @param gwrapper
+     * @param attributeName
+     * @param band
+     * @return
+     */
+   public static FeatureCollection toPolygons(
+           GridWrapperNotInterpolated gwrapper, String attributeName, int 
band) {
+       final FeatureSchema featSchema = new FeatureSchema();
+       featSchema.addAttribute("GEOMETRY", AttributeType.GEOMETRY);
+       featSchema.addAttribute("ID", AttributeType.INTEGER);
+       featSchema.addAttribute(attributeName, AttributeType.DOUBLE);
+       // Create feature collection
+        FeatureCollection featColl = new FeatureDataset(featSchema);
+     
+       
+       featColl = toPolygonsSextante(
+               gwrapper, attributeName, band);
+       
+      
+       return featColl;
+   }    
+    
 }



_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to