# HG changeset patch # User Sascha L. Teichmann # Date 1263055219 0 # Node ID 0dcf068fb55224233843a7ca715bce2f93d1f8a5 # Parent ccd976fc0f7be0c509b611916158834d8fbce22b Added method to figure out interpolation method for a given string in raster tiles. geo-backend/trunk@521 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r ccd976fc0f7b -r 0dcf068fb552 geo-backend/ChangeLog --- 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 + + * 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 * src/main/java/de/intevation/gnv/geobackend/sde/datasources/RasterObject.java: diff -r ccd976fc0f7b -r 0dcf068fb552 geo-backend/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; + } }