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.ProjParameters; 010 import org.openstreetmap.josm.data.projection.proj.TransverseMercator; 011 012 /** 013 * SWEREF99 13 30 projection. Based on data from spatialreference.org. 014 * http://spatialreference.org/ref/epsg/3008/ 015 * 016 * @author Hanno Hecker 017 */ 018 public class Epsg3008 extends AbstractProjection { 019 020 public Epsg3008() { 021 ellps = Ellipsoid.GRS80; 022 proj = new org.openstreetmap.josm.data.projection.proj.TransverseMercator(); 023 try { 024 proj.initialize(new ProjParameters() {{ ellps = Epsg3008.this.ellps; }}); 025 } catch (ProjectionConfigurationException e) { 026 throw new RuntimeException(e); 027 } 028 datum = GRS80Datum.INSTANCE; 029 lon_0 = 13.5; 030 x_0 = 150000; 031 } 032 033 @Override 034 public String toString() { 035 return tr("SWEREF99 13 30 / EPSG:3008 (Sweden)"); 036 } 037 038 @Override 039 public Integer getEpsgCode() { 040 return 3008; 041 } 042 043 @Override 044 public int hashCode() { 045 return toCode().hashCode(); 046 } 047 048 @Override 049 public String getCacheDirectoryName() { 050 return "epsg"+ getEpsgCode(); 051 } 052 053 @Override 054 public Bounds getWorldBoundsLatLon() { 055 return new Bounds( 056 new LatLon(55.2, 12.1), 057 new LatLon(62.26, 14.65), false); 058 } 059 060 }