code: public static double getValueAt( Window window, Coordinate coordinate, String filePath, IHMProgressMonitor pm )
              throws Exception {
          JGrassMapEnvironment mapEnvironment = new JGrassMapEnvironment(new File(filePath));
          if (window == null) {
              JGrassRegion jgr = mapEnvironment.getActiveRegion();
              window = new Window(jgr.getWest(), jgr.getEast(), jgr.getSouth(), jgr.getNorth(), jgr.getWEResolution(),
                      jgr.getNSResolution());
          }
          Window rectangleAroundPoint = GrassLegacyUtilities.getRectangleAroundPoint(window, coordinate.x, coordinate.y);
  
          OmsGrassLegacyReader reader = new OmsGrassLegacyReader();
          reader.file = filePath;
          reader.inWindow = rectangleAroundPoint;
          if (pm != null)
              reader.pm = pm;
          reader.readCoverage();
          double[][] data = reader.geodata;
  
          if (data.length != 1 || data[0].length != 1) {
              throw new IllegalAccessException("Wrong region extracted for picking a single point.");
          }
  
          return data[0][0];
      }
docs: Get a single value in a position of the raster.
  
  <p>This opens and closes the raster every time it is called. Bad performance on many calls.
  
  @param window the grid on which to base on (if <code>null</code>, the active region is picked).
  @param coordinate the coordinate in which the value is read.
  @param filePath the path to the map.
  @param pm the progress monitor or null.
  @return the value read in the given coordinate.
  @throws Exception