1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.data.projection;
|
---|
3 |
|
---|
4 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
5 |
|
---|
6 | import org.openstreetmap.josm.data.Bounds;
|
---|
7 | import org.openstreetmap.josm.data.coor.LatLon;
|
---|
8 | import org.openstreetmap.josm.data.projection.datum.GRS80Datum;
|
---|
9 | import 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 | */
|
---|
17 | public 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));
|
---|
59 | }
|
---|
60 | }
|
---|