/* * JGrass - Free Open Source Java GIS http://www.jgrass.org * (C) HydroloGIS - www.hydrologis.com * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Library General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) any * later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more * details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Foundation, Inc., 59 * Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package org.jgrasstools.modules; import static org.jgrasstools.hortonmachine.i18n.HortonMessages.OMSSPLITSUBBASINS_AUTHORCONTACTS; import static org.jgrasstools.hortonmachine.i18n.HortonMessages.OMSSPLITSUBBASINS_AUTHORNAMES; import static org.jgrasstools.hortonmachine.i18n.HortonMessages.OMSSPLITSUBBASINS_DESCRIPTION; import static org.jgrasstools.hortonmachine.i18n.HortonMessages.OMSSPLITSUBBASINS_KEYWORDS; import static org.jgrasstools.hortonmachine.i18n.HortonMessages.OMSSPLITSUBBASINS_LABEL; import static org.jgrasstools.hortonmachine.i18n.HortonMessages.OMSSPLITSUBBASINS_LICENSE; import static org.jgrasstools.hortonmachine.i18n.HortonMessages.OMSSPLITSUBBASINS_NAME; import static org.jgrasstools.hortonmachine.i18n.HortonMessages.OMSSPLITSUBBASINS_STATUS; import static org.jgrasstools.hortonmachine.i18n.HortonMessages.OMSSPLITSUBBASINS_inFlow_DESCRIPTION; import static org.jgrasstools.hortonmachine.i18n.HortonMessages.OMSSPLITSUBBASINS_inHack_DESCRIPTION; import static org.jgrasstools.hortonmachine.i18n.HortonMessages.OMSSPLITSUBBASINS_outNetnum_DESCRIPTION; import static org.jgrasstools.hortonmachine.i18n.HortonMessages.OMSSPLITSUBBASINS_outSubbasins_DESCRIPTION; import static org.jgrasstools.hortonmachine.i18n.HortonMessages.OMSSPLITSUBBASINS_pHackorder_DESCRIPTION; import oms3.annotations.Author; import oms3.annotations.Description; import oms3.annotations.Execute; import oms3.annotations.In; import oms3.annotations.Keywords; import oms3.annotations.Label; import oms3.annotations.License; import oms3.annotations.Name; import oms3.annotations.Status; import oms3.annotations.UI; import org.jgrasstools.gears.libs.modules.JGTConstants; import org.jgrasstools.gears.libs.modules.JGTModel; import org.jgrasstools.hortonmachine.modules.demmanipulation.splitsubbasin.OmsSplitSubbasins; @Description(OMSSPLITSUBBASINS_DESCRIPTION) @Author(name = OMSSPLITSUBBASINS_AUTHORNAMES, contact = OMSSPLITSUBBASINS_AUTHORCONTACTS) @Keywords(OMSSPLITSUBBASINS_KEYWORDS) @Label(OMSSPLITSUBBASINS_LABEL) @Name("_" + OMSSPLITSUBBASINS_NAME) @Status(OMSSPLITSUBBASINS_STATUS) @License(OMSSPLITSUBBASINS_LICENSE) public class SplitSubbasins extends JGTModel { @Description(OMSSPLITSUBBASINS_inFlow_DESCRIPTION) @UI(JGTConstants.FILEIN_UI_HINT) @In public String inFlow = null; @Description(OMSSPLITSUBBASINS_inHack_DESCRIPTION) @UI(JGTConstants.FILEIN_UI_HINT) @In public String inHack = null; @Description(OMSSPLITSUBBASINS_pHackorder_DESCRIPTION) @In public Double pHackorder = null; @Description(OMSSPLITSUBBASINS_outNetnum_DESCRIPTION) @UI(JGTConstants.FILEOUT_UI_HINT) @In public String outNetnum = null; @Description(OMSSPLITSUBBASINS_outSubbasins_DESCRIPTION) @UI(JGTConstants.FILEOUT_UI_HINT) @In public String outSubbasins = null; @Execute public void process() throws Exception { OmsSplitSubbasins splitsubbasins = new OmsSplitSubbasins(); splitsubbasins.inFlow = getRaster(inFlow); splitsubbasins.inHack = getRaster(inHack); splitsubbasins.pHackorder = pHackorder; splitsubbasins.pm = pm; splitsubbasins.doProcess = doProcess; splitsubbasins.doReset = doReset; splitsubbasins.process(); dumpRaster(splitsubbasins.outNetnum, outNetnum); dumpRaster(splitsubbasins.outSubbasins, outSubbasins); } }