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 | import org.openstreetmap.josm.data.projection.proj.TransverseMercator;
|
---|
11 |
|
---|
12 | /**
|
---|
13 | * SWEREF99 13 30 projection. Based on data from spatialreference.org.
|
---|
14 | * http://spatialreference.org/ref/epsg/3008/
|
---|
15 | *
|
---|
16 | * @author Hanno Hecker
|
---|
17 | */
|
---|
18 | public class Epsg3008 extends AbstractProjection {
|
---|
19 |
|
---|
20 | public Epsg3008() {
|
---|
21 | ellps = Ellipsoid.GRS80;
|
---|
22 | proj = new org.openstreetmap.josm.data.projection.proj.TransverseMercator();
|
---|
23 | try {
|
---|
24 | proj.initialize(new ProjParameters() {{ ellps = Epsg3008.this.ellps; }});
|
---|
25 | } catch (ProjectionConfigurationException e) {
|
---|
26 | throw new RuntimeException(e);
|
---|
27 | }
|
---|
28 | datum = GRS80Datum.INSTANCE;
|
---|
29 | lon_0 = 13.5;
|
---|
30 | x_0 = 150000;
|
---|
31 | }
|
---|
32 |
|
---|
33 | @Override
|
---|
34 | public String toString() {
|
---|
35 | return tr("SWEREF99 13 30 / EPSG:3008 (Sweden)");
|
---|
36 | }
|
---|
37 |
|
---|
38 | @Override
|
---|
39 | public Integer getEpsgCode() {
|
---|
40 | return 3008;
|
---|
41 | }
|
---|
42 |
|
---|
43 | @Override
|
---|
44 | public int hashCode() {
|
---|
45 | return toCode().hashCode();
|
---|
46 | }
|
---|
47 |
|
---|
48 | @Override
|
---|
49 | public String getCacheDirectoryName() {
|
---|
50 | return "epsg"+ getEpsgCode();
|
---|
51 | }
|
---|
52 |
|
---|
53 | @Override
|
---|
54 | public Bounds getWorldBoundsLatLon() {
|
---|
55 | return new Bounds(
|
---|
56 | new LatLon(55.2, 12.1), // new LatLon(-90.0, -180.0),
|
---|
57 | new LatLon(62.26, 14.65)); // new LatLon(90.0, 180.0));
|
---|
58 | }
|
---|
59 |
|
---|
60 | }
|
---|