source: josm/trunk/src/org/openstreetmap/josm/data/projection/Projections.java@ 4382

Last change on this file since 4382 was 4289, checked in by bastiK, 13 years ago

add Gauß-Krüger projection

File size: 1.8 KB
Line 
1// License: GPL. Copyright 2007 by Immanuel Scholz and others
2package org.openstreetmap.josm.data.projection;
3
4import java.util.ArrayList;
5import java.util.Arrays;
6
7import org.openstreetmap.josm.Main;
8import org.openstreetmap.josm.data.coor.EastNorth;
9import org.openstreetmap.josm.data.coor.LatLon;
10
11/**
12 * Class to handle projections
13 *
14 */
15public class Projections {
16 /**
17 * List of all available projections.
18 */
19 private static ArrayList<Projection> allProjections =
20 new ArrayList<Projection>(Arrays.asList(new Projection[] {
21 // global projections
22 new Epsg4326(),
23 new Mercator(),
24 new UTM(),
25 // regional - alphabetical order by country name
26 new GaussKrueger(),
27 new LambertEST(),
28 new Lambert(),
29 new LambertCC9Zones(),
30 new UTM_France_DOM(),
31 new TransverseMercatorLV(),
32 new Puwg(),
33 new Epsg3008(), // SWEREF99 13 30
34 new SwissGrid(),
35 }));
36
37 public static ArrayList<Projection> getProjections() {
38 return allProjections;
39 }
40
41 /**
42 * Adds a new projection to the list of known projections.
43 *
44 * For Plugins authors: make sure your plugin is an early plugin, i.e. put
45 * Plugin-Early=true in your Manifest.
46 */
47 public static void addProjection(Projection proj) {
48 allProjections.add(proj);
49 }
50
51 static public EastNorth project(LatLon ll) {
52 if (ll == null) return null;
53 return Main.getProjection().latlon2eastNorth(ll);
54 }
55
56 static public LatLon inverseProject(EastNorth en) {
57 if (en == null) return null;
58 return Main.getProjection().eastNorth2latlon(en);
59 }
60}
Note: See TracBrowser for help on using the repository browser.