Mercurial > dive4elements > river
view artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/ShapeFacet.java @ 6152:0587819960c3
Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Sun, 02 Jun 2013 17:52:53 +0200 |
parents | c35323148b98 |
children | e4606eae8ea5 |
line wrap: on
line source
package org.dive4elements.river.artifacts.model.map; import java.io.File; import org.apache.log4j.Logger; import org.dive4elements.artifactdatabase.state.DefaultFacet; import org.dive4elements.artifacts.Artifact; import org.dive4elements.artifacts.CallContext; import org.dive4elements.artifacts.common.utils.Config; import org.dive4elements.river.artifacts.D4EArtifact; public class ShapeFacet extends DefaultFacet { private static Logger logger = Logger.getLogger(ShapeFacet.class); private static final String BASE_DIR = "/artifact-database/floodmap/shapefile-path/@value"; /** * Defaults to ADVANCE Compute type. * @param name Name of the facet. * @param description maybe localized description of the facet. */ public ShapeFacet(String name, String description) { super(name, description); } /** * Return computation result. */ @Override public Object getData(Artifact artifact, CallContext context) { D4EArtifact flys = (D4EArtifact)artifact; String tmp = Config.getStringXPath(BASE_DIR); String baseDir = Config.replaceConfigDir(tmp); baseDir += "/" + flys.identifier(); File shapeDir = new File(baseDir); if (shapeDir.exists()) { return shapeDir; } return null; } }