/** * Appends the given geographic bounding box in a {@code BBOX[…]} element. * Longitude and latitude values will be formatted in decimal degrees. * Longitudes are relative to the Greenwich meridian, with values increasing toward East. * Latitudes values are increasing toward North. * * <div class="section">Numerical precision</div> * The ISO 19162 standards recommends to format those values with only 2 decimal digits. * This is because {@code GeographicBoundingBox} does not specify the datum, so this box * is an approximated information only. * * @param bbox the geographic bounding box to append to the WKT, or {@code null}. * @param fractionDigits the number of fraction digits to use. The recommended value is 2. */ public void append(final GeographicBoundingBox bbox, final int fractionDigits) { if (bbox != null) { openElement(isComplement, WKTKeywords.BBox); setColor(ElementKind.EXTENT); numberFormat.setMinimumFractionDigits(fractionDigits); numberFormat.setMaximumFractionDigits(fractionDigits); numberFormat.setRoundingMode(RoundingMode.FLOOR); appendPreset(bbox.getSouthBoundLatitude()); appendPreset(bbox.getWestBoundLongitude()); numberFormat.setRoundingMode(RoundingMode.CEILING); appendPreset(bbox.getNorthBoundLatitude()); appendPreset(bbox.getEastBoundLongitude()); resetColor(); closeElement(isComplement); } }
/** * Appends the given geographic bounding box in a {@code BBOX[…]} element. * Longitude and latitude values will be formatted in decimal degrees. * Longitudes are relative to the Greenwich meridian, with values increasing toward East. * Latitudes values are increasing toward North. * * <div class="section">Numerical precision</div> * The ISO 19162 standards recommends to format those values with only 2 decimal digits. * This is because {@code GeographicBoundingBox} does not specify the datum, so this box * is an approximative information only. * * @param bbox the geographic bounding box to append to the WKT, or {@code null}. * @param fractionDigits the number of fraction digits to use. The recommended value is 2. */ public void append(final GeographicBoundingBox bbox, final int fractionDigits) { if (bbox != null) { openElement(isComplement, WKTKeywords.BBox); setColor(ElementKind.EXTENT); numberFormat.setMinimumFractionDigits(fractionDigits); numberFormat.setMaximumFractionDigits(fractionDigits); numberFormat.setRoundingMode(RoundingMode.FLOOR); appendPreset(bbox.getSouthBoundLatitude()); appendPreset(bbox.getWestBoundLongitude()); numberFormat.setRoundingMode(RoundingMode.CEILING); appendPreset(bbox.getNorthBoundLatitude()); appendPreset(bbox.getEastBoundLongitude()); resetColor(); closeElement(isComplement); } }
numberFormat.setMinimumFractionDigits(minimumFractionDigits); numberFormat.setMaximumFractionDigits(maximumFractionDigits); numberFormat.setRoundingMode(RoundingMode.FLOOR); appendPreset(min); numberFormat.setRoundingMode(RoundingMode.CEILING); appendPreset(max); final Unit<?> unit = range.unit(); if (!convention.isSimplified() || !Units.METRE.equals(unit)) {
numberFormat.setMinimumFractionDigits(minimumFractionDigits); numberFormat.setMaximumFractionDigits(maximumFractionDigits); numberFormat.setRoundingMode(RoundingMode.FLOOR); appendPreset(min); numberFormat.setRoundingMode(RoundingMode.CEILING); appendPreset(max); final Unit<?> unit = range.unit(); if (!convention.isSimplified() || !Units.METRE.equals(unit)) {