Changeset 13173 in josm for trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
- Timestamp:
- 2017-11-28T00:56:29+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
r12873 r13173 9 9 import static java.lang.Math.sqrt; 10 10 import static org.openstreetmap.josm.data.projection.Ellipsoid.WGS84; 11 import static org.openstreetmap.josm.tools.I18n.trc;12 11 import static org.openstreetmap.josm.tools.Utils.toRadians; 13 12 … … 15 14 import java.text.DecimalFormat; 16 15 import java.text.NumberFormat; 17 import java.util.Arrays;18 16 import java.util.Locale; 19 17 import java.util.Objects; … … 21 19 import org.openstreetmap.josm.Main; 22 20 import org.openstreetmap.josm.data.Bounds; 23 import org.openstreetmap.josm.data.coor.conversion.DMSCoordinateFormat;24 import org.openstreetmap.josm.data.coor.conversion.DecimalDegreesCoordinateFormat;25 import org.openstreetmap.josm.data.coor.conversion.LatLonParser;26 import org.openstreetmap.josm.data.coor.conversion.NauticalCoordinateFormat;27 21 import org.openstreetmap.josm.tools.Logging; 28 22 import org.openstreetmap.josm.tools.Utils; … … 87 81 88 82 /** 89 * Character denoting South, as string.90 * @deprecated use {@link LatLonParser#SOUTH}91 */92 @Deprecated93 public static final String SOUTH = trc("compass", "S");94 /**95 * Character denoting North, as string.96 * @deprecated use {@link LatLonParser#NORTH}97 */98 @Deprecated99 public static final String NORTH = trc("compass", "N");100 /**101 * Character denoting West, as string.102 * @deprecated use {@link LatLonParser#WEST}103 */104 @Deprecated105 public static final String WEST = trc("compass", "W");106 /**107 * Character denoting East, as string.108 * @deprecated use {@link LatLonParser#EAST}109 */110 @Deprecated111 public static final String EAST = trc("compass", "E");112 113 /**114 83 * Replies true if lat is in the range [-90,90] 115 84 * … … 185 154 186 155 /** 187 * Replies the coordinate in degrees/minutes/seconds format188 * @param pCoordinate The coordinate to convert189 * @return The coordinate in degrees/minutes/seconds format190 * @deprecated use {@link #degreesMinutesSeconds} instead191 */192 @Deprecated193 public static String dms(double pCoordinate) {194 return degreesMinutesSeconds(pCoordinate);195 }196 197 /**198 * Replies the coordinate in degrees/minutes/seconds format199 * @param pCoordinate The coordinate to convert200 * @return The coordinate in degrees/minutes/seconds format201 * @since 12561202 * @deprecated use {@link DMSCoordinateFormat#degreesMinutesSeconds(double)}203 */204 @Deprecated205 public static String degreesMinutesSeconds(double pCoordinate) {206 return DMSCoordinateFormat.degreesMinutesSeconds(pCoordinate);207 }208 209 /**210 * Replies the coordinate in degrees/minutes format211 * @param pCoordinate The coordinate to convert212 * @return The coordinate in degrees/minutes format213 * @since 12537214 * @deprecated use {@link NauticalCoordinateFormat#degreesMinutes(double)}215 */216 @Deprecated217 public static String degreesMinutes(double pCoordinate) {218 return NauticalCoordinateFormat.degreesMinutes(pCoordinate);219 }220 221 /**222 * Replies the coordinate in degrees/minutes format223 * @param pCoordinate The coordinate to convert224 * @return The coordinate in degrees/minutes format225 * @deprecated use {@link #degreesMinutes(double)} instead226 */227 @Deprecated228 public static String dm(double pCoordinate) {229 return degreesMinutes(pCoordinate);230 }231 232 /**233 156 * Constructs a new object representing the given latitude/longitude. 234 157 * @param lat the latitude, i.e., the north-south position in degrees … … 252 175 } 253 176 254 /**255 * Formats the latitude part according to the given format256 * @param d the coordinate format to use257 * @return the formatted latitude258 * @deprecated use {@link org.openstreetmap.josm.data.coor.conversion.ICoordinateFormat#latToString(ILatLon)}259 */260 @Deprecated261 public String latToString(CoordinateFormat d) {262 return d.getICoordinateFormat().latToString(this);263 }264 265 177 @Override 266 178 public double lon() { 267 179 return x; 268 }269 270 /**271 * Formats the longitude part according to the given format272 * @param d the coordinate format to use273 * @return the formatted longitude274 * @deprecated use {@link org.openstreetmap.josm.data.coor.conversion.ICoordinateFormat#lonToString(ILatLon)}275 */276 @Deprecated277 public String lonToString(CoordinateFormat d) {278 return d.getICoordinateFormat().lonToString(this);279 180 } 280 181 … … 409 310 410 311 /** 411 * Returns this lat/lon pair in human-readable format separated by {@code separator}.412 * @param separator values separator413 * @return String in the format {@code "1.23456[separator]2.34567"}414 * @deprecated method removed without replacement415 */416 @Deprecated417 public String toStringCSV(String separator) {418 return Utils.join(separator, Arrays.asList(419 DecimalDegreesCoordinateFormat.INSTANCE.latToString(this),420 DecimalDegreesCoordinateFormat.INSTANCE.lonToString(this)421 ));422 }423 424 /**425 312 * Interpolate between this and a other latlon 426 313 * @param ll2 The other lat/lon object … … 506 393 Double.compare(that.y, y) == 0; 507 394 } 508 509 /**510 * Parses the given string as lat/lon.511 * @param coord String to parse512 * @return parsed lat/lon513 * @since 11045514 * @deprecated use {@link LatLonParser#parse(java.lang.String)}515 */516 @Deprecated517 public static LatLon parse(String coord) {518 return LatLonParser.parse(coord);519 }520 395 }
Note:
See TracChangeset
for help on using the changeset viewer.