Linking environmental models together to make the world a better place: the GIS approach
Upcoming SlideShare
Loading in...5
×
 

Linking environmental models together to make the world a better place: the GIS approach

on

  • 2,093 views

The JGrass team has spent the last 5 years to try to create an appropriate ecosystem for researchers to share their knowledge and for professionals to have innovative tools at hand. The long road lead ...

The JGrass team has spent the last 5 years to try to create an appropriate ecosystem for researchers to share their knowledge and for professionals to have innovative tools at hand. The long road lead through various applications and libraries, from GRASS to JGrass, from JGrass to uDig, from OpenMI to OMS. The current scenario presents a central library, the JGrasstools, and the desktop GIS framework uDig. All glued through the OMS3 modeling system, a code annotation framework developed in joint effort between Colorado State University and USDA, that supports the connection between models from different authors and domains.

Statistics

Views

Total Views
2,093
Views on SlideShare
2,093
Embed Views
0

Actions

Likes
2
Downloads
20
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Linking environmental models together to make the world a better place: the GIS approach Linking environmental models together to make the world a better place: the GIS approach Presentation Transcript

  • Linking environmental models together to make the world a better place: the GIS approach Geoinformatics FCE CTU Prague, Czech Republic, 19th of May 2011 Andrea Antonello (HydroloGIS) Olaf David (Colorado State University/USDA)
  • The importance of being... GISa container for environmental sciences...
  • Horton Machine, geo-hydro toolbox in GRASS
  • JGrass, hydro-geomorphology based on GRASS formats • first wanted to be a userfriendly gui for GRASS • a toolbox for geomorphology and hydrologySoon it became clear what was missing to make the worlda better place: • a standard (accepted) modelling system • a modern, mature and extensible rich client framework
  • uDig, the GIS app to create apps
  • ...the glue for different applications?The reciepe so far: • GIS • a fair amount of science •?
  • What do we mean when we say linking models? A simple example ESRI ASCII, TIF, GRASS ESRI ASCII, TIF, GRASS COVERAGE READER PITFILLER COVERAGE WRITER
  • Still a simple exampleESRI ASCII, TIF, GRASS COVERAGE READER PITFILLER ESRI ASCII, TIF, GRASS FLOWDIRECTIONS COVERAGE WRITER
  • Still a simple example, but trickierESRI ASCII, TIF, GRASS ESRI ASCII, TIF, GRASS COVERAGE READER PITFILLER COVERAGE WRITER ESRI ASCII, TIF, GRASS FLOWDIRECTIONS COVERAGE WRITER
  • But what about this? GRADIENTESRI ASCII, TIF, GRASS COVERAGE READER CURVATURES PITFILLERFLOWDIRECTIONS DRAIDIR AB EXTRACTNETWORK RESCALED DISTANCE SUP E SUB TOPINDEX RAINFALL AND PEAKFLOW SATURATION CSV, DATABASE PARAMETERS WRITER
  • And this? ity wind e humid pres rature d ENERGY INDEX relativ re spee tempe su CSV, DATABASE READER ity rela ssure ture JAMI pe mid rain pre pera other meteo d s hu ed win tive tem interpolation KRIGING rain rain interpolation ENERGY BALANCEbasins s o ns sin tatirain gauges ba teo s me Pnet, SWE ns SHAPEFILE basi AND POSTGIS CSV, DATABASE READER SNOW, GLACIER WRITER VEGETATION PARAMETERS
  • And then there is timeConsider there will be parameters and modules that execute just once, theremight be an external timeline, which could even be paused when no data areavailable. 1x calc ity wind e humid pres rature d ENERGY INDEX relativ re spee tempe CSV, DATABASE su READER ity rela ssure ture JAMI pe mid rain pre pera other meteo d s hu ed win tive tem interpolation KRIGING rain rain interpolation basins rain gauges SHAPEFILE AND POSTGIS sin s ba teo s me tati on basi ns s t ENERGY BALANCE Pnet, SWE CSV, DATABASE READER SNOW, GLACIER WRITERpause dt VEGETATION PARAMETERS 1x param
  • What other problems do we have for a modelling environment to work?• modules come from different authors• modules come in different.. ehm flavours• nowadays it should be possible to load library modules at runtime• they should not change the original code too much• to be able to connect them, the modules need to be datatype abstract• ...and possibly have the timeline external
  • What do we mean when we say linking models?inputFilePathForModule1 t1...tn outputFilePathOfModule1 t1...tn DATA READER MODULE 1 DATA WRITER DATA READER MODULE 2 DATA WRITER inputFilePathForModule1 outputFilePathOfModule1 DATA READER DATA WRITER MODULE 1 MODULE 2 t1 tn
  • The (European) OpenMI approachConsidering that: • OpenMI seemed to become de facto a standard (still) • important actors in hydrology (ex. DHI and Deltares) • OpenMI was missing GIS notionsWe decided to: • invest two years to migrate our modules to that framework • invest time and resources to join the technical steering committee
  • The (European) OpenMI approachThe modelling approach was the usual. Init your thing,then execute, at the end dispose. public void initialize( IArgument[] properties ) throws Exception { // ... } public IValueSet getValues( ITime time, String linkID ) throws Exception { // ... }Being OpenMI a set of standard interfaces, theuser/developer is forced to follow those apis.
  • The (European) OpenMI approachWe learned that: • for our purposes the framework was too invasive (for large models than many small modules?) • migration effort was too big • by the time we finished a new major release was ready • at that time we were the only ones supplying open source modules (so who to test linking with?) • back then we never were able to get GIS stuff into OpenMI (now they discuss with OGC)
  • The (American) OMS3 approachAt a conference our team came in touch with the ObjectModelling System.Welcome to the Object Modeling System ... modelingframework ... based on components ... project activeamong the U.S. Department of Agriculture and partneragencies ... highly inter-operable and lightweightmodeling framework for component-based model andsimulation development on multiple platforms.Well, we had heared that before.
  • Annotations on your codeBasically OMS3 supplies a set of Annotations to put onthe code to describe it.Class description useful for the generation ofdocumentation and guis. @Description("It fills the depression points present within a DEM.") @Documentation("Pitfiller.html") @Author(name = "David Tarboton") @Keywords("Dem manipulation, Geomorphology, DrainDir") @Label(JGTConstants.DEMMANIPULATION) @Name("pit") @Status(Status.CERTIFIED) public class Pitfiller { // ... }
  • Definition and description of input and output parameter @Description("The map of digital elevation model (DEM).") @In public GridCoverage2D inElev; @Description("The depitted elevation map.") @Out public GridCoverage2D outPit = null;Definition of the method to be executed @Execute public void process() throws Exception { // ... }
  • What about native code? How does OMS3 help?• Use FORTRAN code in OMS directly (no C/C++ bridge required)• Define OMS components in FORTRAN• Integrated with build system• Allow automatic documentation generation from source
  • Requirements?• FORTRAN 90+ syntax• ISO_C_BINDING• GCC 4.4+ / gfortran! @ExecuteSUBROUTINE we(eroout, eroout_len,runoff,peakro,effdrn) ! @In CHARACTER(kind = C_CHAR, len = eroout_len) :: eroout INTEGER(C_INT), intent(in), VALUE :: eroout_len ! @In REAL(C_FLOAT) :: runoff,peakro,effdrn .. http://gcc.gnu.org/onlinedocs/gfortran/ISO_005fC_005fBINDING.html
  • OpenMI vs. OMS3: our experience
  • Extending OMS3 with GIS: the genesis of JGrasstoolsOMS3 brought some important advantages: • USDA has lots of open source OMS3 modules • flat learning curve for instant gratification • fast migration of code • abstraction of I/O is perfect choice, clean code • possibility of external handling of the timelineWe decided to not migrate JGrass to use OMS3, butinstead to extract the processing algorithms to ageomorphologic and hydrologic library, theJGrasstools.
  • What can we find in JGrasstools? EngineeringMajor environmental models: • hydro-geomorphological risk • hydropower, solar potential and renewable energies • LiDAR data analysis
  • Maximum discharge: Peakflow
  • Interpolators: Kriging, Jami
  • Full hydrological cycle: Adige, Hymod
  • Snowmodel, simplified hydraulic model
  • Network ManagementPowerful and well known software for water supplysystem and stormwater network system design andmaintainance: • Epanet • Trento_p
  • Epanet integration in uDig
  • The Horton Machine: geomorphologic and hydrologic toolbox http://code.google.com/p/jgrasstools/wiki/HortonMachine JGrass gears: generic GIS toolbox http://code.google.com/p/jgrasstools/wiki/JGrassGears
  • How to use JGrasstools• in applications (see Epanet for uDig)• through the scripting engine (groovy, oms, geoscript) sim = new oms3.SimBuilder(logging:ALL).sim(name:pitfiller) { model { components { pitfiller pit reader rasterreader writer rasterwriter } parameter { reader.file D:dataspearfish60newuser1celldtm writer.file D:dataspearfish60newuser1cellpit } connect { reader.outRaster pitfiller.inElev pitfiller.outPit writer.inRaster } } } sim.run();
  • • from commandline ./jgrasstools.sh script.oms So what about normal users??
  • OMS3, GIS and JGrasstools made simple Introducing the OmsBoxuser frontend the OmsBox is a frontend for GIS users, a a graphical user interface that can load any OMS3 annotated moduleuDig based eclipse/rcp/uDig plugin to integrate in GIS. Mouse clicks, region settings, raster resolution and all needed GIS notions are supplied to the widgets
  • oms3 generated guis the guis are generated from the OMS3 annotations. The GIS knows only OMS3.gui labels and docs the gui labels and documentations are now responsability of the module developer/maintainerlicensing issues the OmsBox is a LGPL plugin for uDig (compatible with OMS3). Loaded OMS3 libraries can choose the license. JGrasstools is GPL.
  • The OmsBox in uDig• integrated in uDig • region settings auto-fill• drag & drop • different debug levels• listens to clicks • separate processes
  • OmsBox gui generation: @Label
  • OmsBox gui generation: ClassName
  • OmsBox gui generation: @In/@Out fields
  • OmsBox gui generation: field @Description
  • OmsBox gui generation: field @Units and @Range
  • OmsBox gui generation: on the fly documentation
  • OmsBox gui generation: on the fly documentation
  • Geoinformatics FCE CTU Prague, Czech Republic, 19th of May 2011Useful links: • http://www.javaforge.com/project/oms • http://www.jgrasstools.org • http://udig.refractions.net • http://www.geotools.org