Example #1
0
  public ConsoleHelper(String mapsetPath, String remotedbUrl, PrintStream out, PrintStream err) {
    p_remotedbUrl = remotedbUrl;
    File mapsetFile = new File(mapsetPath);
    p_mapsetPath = mapsetFile.getAbsolutePath();
    p_locationPath = mapsetFile.getParent();
    p_mapsetName = mapsetFile.getName();

    if (out == null) {
      p_out = System.out;
    } else {
      p_out = out;
    }
    if (err == null) {
      p_err = System.err;
    } else {
      p_err = err;
    }
    String windPath = p_mapsetPath + File.separator + JGrassConstants.WIND;
    try {
      p_activeRegion = new JGrassRegion(windPath);
    } catch (IOException e) {
      e.printStackTrace();
    }
    north = p_activeRegion.getNorth();
    south = p_activeRegion.getSouth();
    east = p_activeRegion.getEast();
    west = p_activeRegion.getWest();
    weres = p_activeRegion.getWEResolution();
    nsres = p_activeRegion.getNSResolution();
    rows = p_activeRegion.getRows();
    cols = p_activeRegion.getCols();

    monitor = new PrintStreamProgressMonitor(p_out);
  }
Example #2
0
 public static void updateActiveregion() {
   String windPath = p_mapsetPath + File.separator + JGrassConstants.WIND;
   try {
     p_activeRegion = new JGrassRegion(windPath);
   } catch (IOException e) {
     e.printStackTrace();
   }
   north = p_activeRegion.getNorth();
   south = p_activeRegion.getSouth();
   east = p_activeRegion.getEast();
   west = p_activeRegion.getWest();
   weres = p_activeRegion.getWEResolution();
   nsres = p_activeRegion.getNSResolution();
   rows = p_activeRegion.getRows();
   cols = p_activeRegion.getCols();
   p_out.println("Updated active region...");
 }