source: josm/trunk/src/org/openstreetmap/josm/data/projection/datum/CentricDatum.java@ 13601

Last change on this file since 13601 was 8846, checked in by Don-vip, 9 years ago

sonar - fb-contrib - minor performance improvements:

  • Method passes constant String of length 1 to character overridden method
  • Method needlessly boxes a boolean constant
  • Method uses iterator().next() on a List to get the first item
  • Method converts String to boxed primitive using excessive boxing
  • Method converts String to primitive using excessive boxing
  • Method creates array using constants
  • Class defines List based fields but uses them like Sets
  • Property svn:eol-style set to native
File size: 850 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.projection.datum;
3
4import org.openstreetmap.josm.data.coor.LatLon;
5import org.openstreetmap.josm.data.projection.Ellipsoid;
6
7/**
8 * A datum with different ellipsoid than WGS84, but does not require
9 * shift, rotation or scaling.
10 */
11public class CentricDatum extends AbstractDatum {
12
13 public CentricDatum(String name, String proj4Id, Ellipsoid ellps) {
14 super(name, proj4Id, ellps);
15 }
16
17 @Override
18 public LatLon toWGS84(LatLon ll) {
19 return Ellipsoid.WGS84.cart2LatLon(ellps.latLon2Cart(ll));
20 }
21
22 @Override
23 public LatLon fromWGS84(LatLon ll) {
24 return this.ellps.cart2LatLon(Ellipsoid.WGS84.latLon2Cart(ll));
25 }
26
27 @Override
28 public String toString() {
29 return "CentricDatum{ellipsoid="+ellps+'}';
30 }
31}
Note: See TracBrowser for help on using the repository browser.