Mercurial > dive4elements > river
changeset 1910:61baa34af1d4
Use single column wst interpolators from wqkmsinterpolartifact.
flys-artifacts/trunk@3270 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 16 Nov 2011 14:50:19 +0000 |
parents | 4b64692b2d1e |
children | a80d33a3bcca |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/WQKmsInterpolArtifact.java |
diffstat | 2 files changed, 29 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Wed Nov 16 14:47:02 2011 +0000 +++ b/flys-artifacts/ChangeLog Wed Nov 16 14:50:19 2011 +0000 @@ -1,3 +1,9 @@ +2011-11-16 Felix Wolfsteller <felix.wolfsteller@intevation.de> + + * src/main/java/de/intevation/flys/artifacts/WQKmsInterpolArtifact.java: + Added functionality to artifact to use single column wst + interpolators. + 2011-11-16 Felix Wolfsteller <felix.wolfsteller@intevation.de> * src/main/java/de/intevation/flys/artifacts/model/WstValueTableFactory.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WQKmsInterpolArtifact.java Wed Nov 16 14:47:02 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WQKmsInterpolArtifact.java Wed Nov 16 14:50:19 2011 +0000 @@ -91,12 +91,20 @@ if (parts.length >= 4) { int wst = Integer.valueOf(parts[3]); - /* @TODO For certain datasets it might be necessary to - * restrict on a single column of wsts. */ - // int col = Integer.valueOf(parts[2]); - //addStringData("col_pos", parts[2]); + int col = -1; + String colpos = parts[2]; + // Are we interested in a single column or in all columns? + if (colpos.equals("A")) { + ; // Take all. + } + else { + col = Integer.valueOf(colpos); + addStringData("col_pos", parts[2]); + } addStringData("wst_id", parts[3]); - String wkmsName = WKmsFactory.getWKmsName(wst); + String wkmsName = (col > 0) + ? WKmsFactory.getWKmsName(col, wst) + : WKmsFactory.getWKmsName(wst); Facet facet = new WQFacet( Resources.getMsg( callMeta, @@ -167,11 +175,17 @@ * Get WQ at a given km. */ public double [][] getWQAtKm(double km) { + + WstValueTable interpolator = null; // Get WstValueTable - WstValueTable interpolator = WstValueTableFactory.getTable( - getDataAsInt("wst_id")); - // @TODO we might have to give column position for certain datasets. - // getDataAsInt("col_pos")); + if (getDataAsString("col_pos") != null) { + interpolator = WstValueTableFactory.getWstColumnTable( + getDataAsInt("wst_id"), getDataAsInt("col_pos")); + } + else { + interpolator = WstValueTableFactory.getTable( + getDataAsInt("wst_id")); + } double [][] vs = interpolator.interpolateWQColumnwise( getDataAsDouble("ld_locations"));