Esempio n. 1
0
  public static void load(String mapname) {
    if (JGrassPlugin.getDefault() != null) {
      JGrassMapGeoResource addedMap =
          JGrassCatalogUtilities.addMapToCatalog(
              p_locationPath, p_mapsetName, mapname, JGrassConstants.GRASSBINARYRASTERMAP);
      if (addedMap == null)
        p_err.println("An error occurred while trying to add the map to the catalog.");

      IMap activeMap = ApplicationGIS.getActiveMap();
      ApplicationGIS.addLayersToMap(
          activeMap,
          Collections.singletonList((IGeoResource) addedMap),
          activeMap.getMapLayers().size());
    }
  }