Class VectorizeAlgorithm

java.lang.Object
org.openjump.core.rasterimage.algorithms.VectorizeAlgorithm

public class VectorizeAlgorithm extends Object
This class provides a complete set to transform a grid (GridWrapperNotInterpolated.class) derived from a RasterImageLayer.class into vector objetcs. All methods derived from AdbToolbox project, from Sextante and from OpenJUMP inner methods. To build a grid from RasterImageLayer: OpenJUMPSextanteRasterLayer rstLayer = new OpenJUMPSextanteRasterLayer(); rstLayer.create(rLayer, false); GridWrapperNotInterpolated gwrapper = new GridWrapperNotInterpolated(rstLayer, rstLayer.getLayerGridExtent());
Author:
Beppe
  • Field Details

  • Constructor Details

    • VectorizeAlgorithm

      public VectorizeAlgorithm()
  • Method Details

    • toPolygonsAdbToolBox

      public static FeatureCollection toPolygonsAdbToolBox(GridWrapperNotInterpolated gwrapper, boolean explodeMultipolygons, String attributeName, int band)
      Create a FeatureCollection of polygons defining a GridWrapperNotInterpolated and number of band AdbToolbox algorithm
      Parameters:
      gwrapper - GridWrapperNotInterpolated
      explodeMultipolygons - Explode MultiPolygons in Polygons
      band - Number of band (0,1,2,etc)
      Returns:
      a FeatureCollection containing vectorized polygons
    • toPolygonsMikeToolBox

      public static FeatureCollection toPolygonsMikeToolBox(GridWrapperNotInterpolated gwrapper, boolean simplify, String attributeName, int band)
    • toPolygonsSextante

      public static FeatureCollection toPolygonsSextante(GridWrapperNotInterpolated gwrapper, String attributeName, int band)
      Create a FeatureCollection of polygons defining a GridWrapperNotInterpolated and number of band Sextante algorithm
      Parameters:
      gwrapper - a GridWrapperNotInterpolated
      attributeName - an attribute name
      band - the image band to use
      Returns:
      a FeatureCollection containing vectorized polygons
    • toContours

      public FeatureCollection toContours(GridWrapperNotInterpolated gwrapper, double zMin, double zMax, double dDistance, String attributeName, int band)
      Convert a DTM raster to a feature collection of contours (linestrings) defining a GridWrapperNotInterpolated, a minimum and maximun elevations, a vertical distance between each contour, an attribute name and the band of the raster
      Parameters:
      gwrapper - a GridWrapperNotInterpolated
      zMin - minimum elevation
      zMax - maximum elevation
      dDistance - vertical distance between contour lines
      attributeName - attribute name
      band - the band containing elevation data
      Returns:
      a FeatureCollection containing vectorized contour lines
    • toLines

      public FeatureCollection toLines(GridWrapperNotInterpolated gwrapper, String attributeName)
      Convert a line raster a feature collection of linestrings defining a GridWrapperNotInterpolated and an attribute. [Currently not working possibly due to a bug of OpenJUMPSextanteRasterLayer.create method]
      Parameters:
      gwrapper - a GridWrapperNotInterpolated
      attributeName - attribute name
      Returns:
    • toGridPoint

      public FeatureCollection toGridPoint(GridWrapperNotInterpolated gwrapper, int numBands)
    • toPoint

      public FeatureCollection toPoint(GridWrapperNotInterpolated gwrapper, int band)
    • toGridPolygon

      public FeatureCollection toGridPolygon(GridWrapperNotInterpolated gwrapper, int maxCells, int numBands)
    • toPolygons

      public static FeatureCollection toPolygons(GridWrapperNotInterpolated gwrapper, boolean explodeMultipolygons, String attributeName, int band)
      Create a FeatureCollection of polygons defining a GridWrapperNotInterpolated and number of band Sextante algorithm - compatible with OpenKLEM methods
      Parameters:
      gwrapper - a GridWrapperNotInterpolated
      explodeMultipolygons - true to separate disjointed polygons
      attributeName - an attribute name
      band - the image band to use
      Returns:
      a FeatureCollection containing vectorized polygons
    • main

      public static void main(String[] args)