Class LayerTools


public class LayerTools extends ToolToMakeYourLifeEasier
Class for more convenient use of Layer objects. Offers methods e.g. to get features that reside within a given geometry or to easily add a result layer to the map.
Author:
Ole Rahn FH Osnabrück - University of Applied Sciences Osnabrück Project PIROL 2005 Daten- und Wissensmanagement [sstein] - 22.Feb.2009 - modified to work in OpenJUMP
  • Field Details

  • Constructor Details

  • Method Details

    • getSelectedLayers

      public Layer[] getSelectedLayers()
    • getSelectedFeatures

      public List getSelectedFeatures()
    • getFenceGeometry

      public org.locationtech.jts.geom.Geometry getFenceGeometry()
    • getFeaturesInFence

      public List getFeaturesInFence()
    • getFeaturesInFenceInLayer

      public Feature[] getFeaturesInFenceInLayer(Layer layer, org.locationtech.jts.geom.Geometry fenceGeometry)
    • getFeaturesInFenceInLayer

      public Feature[] getFeaturesInFenceInLayer(Feature[] featArray, org.locationtech.jts.geom.Geometry fenceGeometry)
    • getNumSelectedLayers

      public int getNumSelectedLayers()
    • getNumSelectedLayers

      public static int getNumSelectedLayers(PlugInContext context)
    • addStandardResultLayer

      public static Layer addStandardResultLayer(String title, FeatureCollection featCollection, PlugInContext context, FeatureCollectionRole role)
    • addAndSelectStandardResultLayer

      public static Layer addAndSelectStandardResultLayer(String title, FeatureCollection featCollection, Color color, PlugInContext context, FeatureCollectionRole role)
    • addAndSelectStandardResultLayer

      public static Layer addAndSelectStandardResultLayer(String title, FeatureCollection featCollection, PlugInContext context, FeatureCollectionRole role)
    • addStandardResultLayer

      public static Layer addStandardResultLayer(String title, FeatureCollection featCollection, Color color, PlugInContext context, FeatureCollectionRole role)
    • addStandardResultLayer

      public static Layer addStandardResultLayer(String title, FeatureCollection featCollection, Color color, PlugInContext context, boolean select, FeatureCollectionRole role)
    • addStandardResultLayer

      public Layer addStandardResultLayer(String title, FeatureCollection featCollection, FeatureCollectionRole role)
    • getLayer2FeatureMap

      public Map getLayer2FeatureMap(List features)
    • putGeometryArrayIntoMap

      public static Layer putGeometryArrayIntoMap(org.locationtech.jts.geom.Geometry[] geometryArray, PlugInContext context)
    • getLayer2FeatureMap

      public static Map<Layer, List<Feature>> getLayer2FeatureMap(List<Feature> features, PlugInContext context)
    • getResultCategory

      public Category getResultCategory()
    • getResultCategory

      public static Category getResultCategory(PlugInContext context)
    • getSelectedLayers

      public static Layer[] getSelectedLayers(PlugInContext context, int num)
      Get a given number of selected Layers.
      Parameters:
      context - the current PlugInContext
      num - max. number of layers to return, -1 returns all selected layers
      Returns:
      a given number of selected Layers, null if no Layers are selected
    • getSelectedLayer

      public static Layer getSelectedLayer(PlugInContext context)
      get one Layer that is selected
      Parameters:
      context - the current PlugInContext
      Returns:
      one selected Layer, null if no Layers are selected
    • getSelectedLayerable

      public static Layerable getSelectedLayerable(PlugInContext context, Class layerableClass)
      get one Layer that is selected
      Parameters:
      context - the current PlugInContext
      Returns:
      one selected Layer, null if no Layers are selected
    • getSelectedLayerable

      public static Layerable getSelectedLayerable(WorkbenchContext context, Class layerableClass)
      get one Layer that is selected
      Parameters:
      context - the current WorkbenchContext
      Returns:
      one selected Layer, null if no Layers are selected
    • getUniqueLayerName

      public static String getUniqueLayerName(PlugInContext context, String name)
      returns a layername, that is not yet used in the layername panel