001    // License: GPL. For details, see LICENSE file.
002    package org.openstreetmap.josm.data.projection;
003    
004    import static org.openstreetmap.josm.tools.I18n.tr;
005    
006    import org.openstreetmap.josm.data.Bounds;
007    import org.openstreetmap.josm.data.coor.LatLon;
008    import org.openstreetmap.josm.data.projection.datum.GRS80Datum;
009    import org.openstreetmap.josm.data.projection.proj.LambertConformalConic;
010    import org.openstreetmap.josm.data.projection.proj.ProjParameters;
011    
012    /**
013     * Estonian Coordinate System of 1997.
014     *
015     * Thanks to Johan Montagnat and its geoconv java converter application
016     * (http://www.i3s.unice.fr/~johan/gps/ , published under GPL license)
017     * from which some code and constants have been reused here.
018     */
019    public class LambertEST extends AbstractProjection {
020    
021        public LambertEST() {
022            ellps = Ellipsoid.GRS80;
023            datum = GRS80Datum.INSTANCE;
024            lon_0 = 24;
025            x_0 = 500000;
026            y_0 = 6375000;
027            proj = new LambertConformalConic();
028            try {
029                proj.initialize(new ProjParameters() {{
030                    ellps = LambertEST.this.ellps;
031                    lat_0 = 57.517553930555555555555555555556;
032                    lat_1 = 59.0 + 1.0/3.0;
033                    lat_2 = 58.0;
034                }});
035            } catch (ProjectionConfigurationException e) {
036                throw new RuntimeException(e);
037            }
038        }
039    
040        @Override
041        public String toString() {
042            return tr("Lambert Zone (Estonia)");
043        }
044    
045        @Override
046        public Integer getEpsgCode() {
047            return 3301;
048        }
049    
050        @Override
051        public int hashCode() {
052            return getClass().getName().hashCode(); // we have no variables
053        }
054    
055        @Override
056        public String getCacheDirectoryName() {
057            return "lambertest";
058        }
059    
060        @Override
061        public Bounds getWorldBoundsLatLon()
062        {
063            return new Bounds(
064                    new LatLon(56.05, 21.64),
065                    new LatLon(61.13, 28.58), false);
066        }
067    
068    }