Mercurial > dive4elements > river
diff artifacts/src/main/java/org/dive4elements/river/artifacts/StaticWQKmsArtifact.java @ 8876:23264d1a528f
Allow access to staticwqkms data; also allow to acces by km range
author | gernotbelger |
---|---|
date | Thu, 08 Feb 2018 18:47:36 +0100 |
parents | 5e38e2924c07 |
children | 3f49835a00c3 |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/StaticWQKmsArtifact.java Thu Feb 08 18:46:34 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/StaticWQKmsArtifact.java Thu Feb 08 18:47:36 2018 +0100 @@ -181,6 +181,24 @@ return res; } + /** + * Get WQKms from factory. + * @return WQKms according to parameterization (can be null); + */ + public WQKms getWQKms(final double from, final double to) { + log.debug("StaticWQKmsArtifact.getWQKms"); + + int col = Integer.parseInt(getDataAsString("col_pos")); + int wst = Integer.parseInt(getDataAsString("wst_id")); + + /** TODO do not run twice against db to do this. */ + String wkmsName = WKmsFactory.getWKmsName(col, wst); + + WQKms res = WQKmsFactory.getWQKms(col, wst, from, to); + res.setName(wkmsName); + return res; + } + /** Return specific name. */ @Override public String getName() {