Sunday, June 19, 2011

Learning JGrassTools

I've been spending some time learning how to use JGrassTools. This is one of the examples from the wiki <http://code.google.com/p/jgrasstools/wiki/JGrassTools4CLI> that I started with. Hopefully, more posts will follow.


// creation of the simulation object
sim = new oms3.SimBuilder(logging:'ALL').sim(name:'pit+viewer') {
   // the model space
   model {
      // space for the definition of the acting components
      components  {
      'pitfiller'    'pit'
      'reader'        'rasterreader'
      'writer'        'rasterwriter'
      'viewer'        'mapsviewer'
      }
     
      // initialization of the parameters
      parameter  {
      'reader.file'        '/Users/justinjent/GrassData/puertoRico_GRS80_NAD83_UTM19/jgrass/cell/rioGrande'
      'writer.file'        '/Users/justinjent/GrassData/puertoRico_GRS80_NAD83_UTM19/jgrass/cell/rioGrande_pit'
      }
    
      // connection of the different components
      connect  {
      'reader.outRaster'    'pitfiller.inElev'
      'pitfiller.outPit'    'writer.inRaster'
      'pitfiller.outPit'    'viewer.inRaster'
      }
   }
}
// start of the simulation
sim.run();

No comments:

Post a Comment