Mercurial > dive4elements > gnv-client
changeset 549:0dcf068fb552
Added method to figure out interpolation method for a given string in raster tiles.
geo-backend/trunk@521 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Sat, 09 Jan 2010 16:40:19 +0000 |
parents | ccd976fc0f7b |
children | 84ba7cbff791 |
files | geo-backend/ChangeLog geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/RasterObject.java |
diffstat | 2 files changed, 18 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/geo-backend/ChangeLog Sat Jan 09 16:12:10 2010 +0000 +++ b/geo-backend/ChangeLog Sat Jan 09 16:40:19 2010 +0000 @@ -1,3 +1,9 @@ +2009-01-09 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * src/main/java/de/intevation/gnv/geobackend/sde/datasources/RasterObject.java: + Added static method to fetch matching interpolation type for + given string. Defaults to nearest neighbor if no string is matching. + 2009-01-09 Sascha L. Teichmann <sascha.teichmann@intevation.de> * src/main/java/de/intevation/gnv/geobackend/sde/datasources/RasterObject.java:
--- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/RasterObject.java Sat Jan 09 16:12:10 2010 +0000 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/RasterObject.java Sat Jan 09 16:40:19 2010 +0000 @@ -172,4 +172,16 @@ return get(posX, posY); } + + public static final int getInterpolationType(String key) { + if (key == null || (key = key.trim().toLowerCase()).length() == 0) { + return NEAREST_NEIGHBOR; + } + + if ("bilinear".equals(key)) { + return BILINEAR; + } + + return NEAREST_NEIGHBOR; + } }