+ /**
+ * Restrict the given coordinate to a limited number of decimal places for display
+ * @param inCoord coordinate string
+ * @return chopped string
+ */
+ private static String restrictDP(String inCoord)
+ {
+ final int DECIMAL_PLACES = 7;
+ if (inCoord == null) return "";
+ final int dotPos = Math.max(inCoord.lastIndexOf('.'), inCoord.lastIndexOf(','));
+ if (dotPos >= 0) {
+ final int chopPos = dotPos + DECIMAL_PLACES;
+ if (chopPos < (inCoord.length()-1)) {
+ return inCoord.substring(0, chopPos);
+ }
+ }
+ return inCoord;
+ }
+