source: josm/trunk/src/org/openstreetmap/josm/data/projection/TransverseMercatorLV.java @ 5241

Revision 5235, 1.6 KB checked in by bastiK, 9 days ago (diff)

no rounding for projection bounds, to avoid 42 being dispayed as 41.99999999999

  • Property svn:eol-style set to native
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.projection;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5
6import org.openstreetmap.josm.data.Bounds;
7import org.openstreetmap.josm.data.coor.LatLon;
8import org.openstreetmap.josm.data.projection.datum.GRS80Datum;
9import org.openstreetmap.josm.data.projection.proj.ProjParameters;
10
11/**
12 * LKS-92/ Latvia TM projection. Based on data from spatialreference.org.
13 * http://spatialreference.org/ref/epsg/3059/
14 *
15 * @author Viesturs Zarins
16 */
17public class TransverseMercatorLV extends AbstractProjection {
18
19    public TransverseMercatorLV() {
20        ellps = Ellipsoid.GRS80;
21        proj = new org.openstreetmap.josm.data.projection.proj.TransverseMercator();
22        try {
23            proj.initialize(new ProjParameters() {{ ellps = TransverseMercatorLV.this.ellps; }});
24        } catch (ProjectionConfigurationException e) {
25            throw new RuntimeException(e);
26        }
27        datum = GRS80Datum.INSTANCE;
28        lon_0 = 24;
29        x_0 = 500000;
30        y_0 = -6000000;
31        k_0 = 0.9996;
32    }
33
34    @Override
35    public String toString() {
36        return tr("LKS-92 (Latvia TM)");
37    }
38
39    @Override
40    public Integer getEpsgCode() {
41        return 3059;
42    }
43
44    @Override
45    public int hashCode() {
46        return toCode().hashCode();
47    }
48
49    @Override
50    public String getCacheDirectoryName() {
51        return "epsg"+ getEpsgCode();
52    }
53
54    @Override
55    public Bounds getWorldBoundsLatLon() {
56        return new Bounds(
57                new LatLon(-90.0, -180.0),
58                new LatLon(90.0, 180.0), false);
59    }
60}
Note: See TracBrowser for help on using the repository browser.