Ignore:
Timestamp:
2013-12-30T10:17:44+01:00 (6 years ago)
Author:
simon04
Message:

fix #9494 - Advanced object info: add "Center of bounding box", and for ways "Centroid"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/coor/LatLon.java

    r6500 r6566  
    1414import java.text.DecimalFormat;
    1515import java.text.NumberFormat;
     16import java.util.Arrays;
    1617import java.util.Locale;
    1718
    1819import org.openstreetmap.josm.Main;
    1920import org.openstreetmap.josm.data.Bounds;
     21import org.openstreetmap.josm.tools.Utils;
    2022
    2123/**
     
    314316    }
    315317
     318    /**
     319     * Returns this lat/lon pair in human-readable format separated by {@code separator}.
     320     * @return String in the format {@code "1.23456[separator]2.34567"}
     321     */
     322    public String toStringCSV(String separator) {
     323        return Utils.join(separator, Arrays.asList(
     324                latToString(CoordinateFormat.DECIMAL_DEGREES),
     325                lonToString(CoordinateFormat.DECIMAL_DEGREES)
     326        ));
     327    }
     328
    316329    public LatLon interpolate(LatLon ll2, double proportion) {
    317330        return new LatLon(this.lat() + proportion * (ll2.lat() - this.lat()),
Note: See TracChangeset for help on using the changeset viewer.