end = end.substring(ind + 1); if (dontAddAlinea) { w.append("\n").append(indent(n)).append(begin); } else if (ind < index || index == -1) { w.append(begin); } else { n++; w.append("\n").append(indent(n)).append(begin); n = checkIndent(end, n); w.append(end); if (i != wktexp.length - 1) { n--; w.append("]],\n").append(indent(n));
/** * Return a String representing the number round to the given tolerance. If * the input double is equal to an integer using the given tolerance, this * method return a number without the ".0". * * @param number the double to transform * @param tol the tolerance * @return * @deprecated this method is repaced by prettyRound, more precise */ @Deprecated public static String roundToString(double number, double tol) { StringBuilder w = new StringBuilder(); if (isInteger(number, tol)) { w.append(Math.round(number)); } else { double res = 1 / tol; w.append(Math.rint(number * res) / res); } return w.toString(); }
/** * Returns a WKT representation of the unit. * */ public String toWKT() { StringBuilder w = new StringBuilder(); w.append("UNIT[\""); w.append(this.getName()); w.append("\","); w.append(PrjWriter.roundToString(this.getScale(), 1e-11)); if (!this.getAuthorityName().startsWith(Identifiable.LOCAL)) { w.append(','); w.append(this.getIdentifier().toWKT()); } w.append(']'); return w.toString(); }
w.append(this.getName()); w.append("\"],PARAMETER[\"").append(Parameter.LATITUDE_OF_ORIGIN).append("\","); w.append(PrjWriter.prettyRound(AngleFormat.rad2deg(this.getLatitudeOfOrigin()), 1e-11)); if (this.getStandardParallel1() != 0.0) { w.append("],PARAMETER[\"").append(Parameter.STANDARD_PARALLEL_1).append("\","); w.append(PrjWriter.prettyRound(AngleFormat.rad2deg(this.getStandardParallel1()), 1e-11)); w.append(PrjWriter.prettyRound(AngleFormat.rad2deg(this.getStandardParallel2()), 1e-11)); w.append(PrjWriter.prettyRound(AngleFormat.rad2deg(this.getCentralMeridian()), 1e-11)); if (this.getAzimuth() != 0.0) { w.append("],PARAMETER[\"").append(Parameter.AZIMUTH).append("\","); w.append(PrjWriter.prettyRound(AngleFormat.rad2deg(this.getAzimuth()), 1e-11)); w.append(PrjWriter.prettyRound(AngleFormat.rad2deg(this.getRectifiedGridAngle()), 1e-11)); w.append(PrjWriter.prettyRound(this.getScaleFactor(), 1e-16)); w.append("],PARAMETER[\"").append(Parameter.FALSE_EASTING).append("\","); w.append(PrjWriter.prettyRound(this.getFalseEasting() / unit.getScale(), 1e-5)); w.append("],PARAMETER[\"").append(Parameter.FALSE_NORTHING).append("\","); w.append(PrjWriter.prettyRound(this.getFalseNorthing() / unit.getScale(), 1e-5)); w.append("]"); return w.toString();