MATSIM
TransformationFactory.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * TransformationFactory.java
4  * *
5  * *********************************************************************** *
6  * *
7  * copyright : (C) 2007 by the members listed in the COPYING, *
8  * LICENSE and WARRANTY file. *
9  * email : info at matsim dot org *
10  * *
11  * *********************************************************************** *
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * See also COPYING, LICENSE and WARRANTY file *
18  * *
19  * *********************************************************************** */
20 
21 package org.matsim.core.utils.geometry.transformations;
22 
24 
31 public abstract class TransformationFactory {
32 
33  public final static String WGS84 = "WGS84";
34  public final static String EPSG4326 = "EPSG:4326";
35  public final static String ATLANTIS = "Atlantis";
36  public final static String CH1903_LV03 = "CH1903_LV03"; // switzerland
37  public final static String CH1903_LV03_Plus = "CH1903_LV03_Plus"; // switzerland new
38  public final static String GK4 = "GK4"; // berlin/germany, own implementation
39  public final static String WGS84_UTM47S = "WGS84_UTM47S"; // indonesia
40  public final static String WGS84_UTM48N = "WGS84_UTM48N"; // Singapore
41  public final static String WGS84_UTM35S = "WGS84_UTM35S"; // South Africa (Gauteng)
42  public final static String WGS84_UTM36S = "WGS84_UTM36S"; // South Africa (eThekwini, Kwazulu-Natal)
43  public final static String WGS84_Albers = "WGS84_Albers"; // South Africa (Africa Albers Equal Conic)
44  public final static String WGS84_SA_Albers = "WGS84_SA_Albers"; // South Africa (Adapted version of Africa Albers Equal)
45  public final static String HARTEBEESTHOEK94_LO19 = "SA_Lo19"; // South Africa adaption of Transverse Mercator. Cape Town
46  public final static String HARTEBEESTHOEK94_LO25 = "SA_Lo25"; // South Africa adaption of Transverse Mercator. Nelson Mandela Bay Metropolitan
47  public final static String HARTEBEESTHOEK94_LO29 = "SA_Lo29"; // South Africa adaption of Transverse Mercator. General for SA as a whole, and Gauteng
48  public final static String HARTEBEESTHOEK94_LO31 = "SA_Lo31"; // South Africa adaption of Transverse Mercator. eThekwini (Durban)
49  public final static String WGS84_UTM33N = "WGS84_UTM33N"; // Berlin
50  public final static String KROVAK = "EPSG5514_KROVAK"; // Czech
51  public final static String DHDN_GK4 = "DHDN_GK4"; // berlin/germany, for GeoTools
52  public final static String WGS84_UTM29N = "WGS84_UTM29N"; // coimbra/portugal
53  public final static String WGS84_UTM31N = "WGS84_UTM31N"; // Barcelona/Spain
54  public final static String CH1903_LV03_GT = "CH1903_LV03_GT"; //use geotools also for swiss coordinate system
55  public final static String CH1903_LV03_Plus_GT = "CH1903_LV03_Plus_GT"; //use geotools also for swiss coordinate system
56  public final static String WGS84_SVY21 = "WGS84_SVY21"; //Singapore2
57  public final static String NAD83_UTM17N = "NAD83_UTM17N"; //Toronto, Canada
58  public static final String WGS84_TM = "WGS84_TM"; //Singapore3
59  public static final String PCS_ITRF2000_TM_UOS = "PCS_ITRF2000_TM_UOS"; // South Korea - but used by University of Seoul - probably a wrong one...
60  public static final String DHDN_SoldnerBerlin = "DHDN_SoldnerBerlin"; // Berlin
61 
70  public static CoordinateTransformation getCoordinateTransformation(final String fromSystem, final String toSystem) {
71  if (fromSystem.equals(toSystem)) return new IdentityTransformation();
72  if (WGS84.equals(fromSystem) || EPSG4326.equalsIgnoreCase(fromSystem)) {
73  if (CH1903_LV03.equals(toSystem)) return new WGS84toCH1903LV03();
74  if (CH1903_LV03_Plus.equals(toSystem)) return new WGS84toCH1903LV03Plus();
75  if (ATLANTIS.equals(toSystem)) return new WGS84toAtlantis();
76  }
77  if (WGS84.equals(toSystem) || EPSG4326.equalsIgnoreCase(toSystem)) {
78  if (CH1903_LV03.equals(fromSystem)) return new CH1903LV03toWGS84();
79  if (CH1903_LV03_Plus.equals(fromSystem)) return new CH1903LV03PlustoWGS84();
80  if (GK4.equals(fromSystem)) return new GK4toWGS84();
81  if (ATLANTIS.equals(fromSystem)) return new AtlantisToWGS84();
82  }
83  return new GeotoolsTransformation(fromSystem, toSystem);
84  }
85 }
static CoordinateTransformation getCoordinateTransformation(final String fromSystem, final String toSystem)