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

Last change on this file since 5039 was 5022, checked in by Don-vip, 12 years ago

see #5387, #7444 - Add Belgian Lambert 1972 (EPSG:31370) and Belgian Lambert 2008 (EPSG:3812) projections

File size: 1.9 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 BelgianLambert1972(),
28 new BelgianLambert2008(),
29 new LambertEST(),
30 new Lambert(),
31 new Lambert93(),
32 new LambertCC9Zones(),
33 new UTM_France_DOM(),
34 new TransverseMercatorLV(),
35 new Puwg(),
36 new Epsg3008(), // SWEREF99 13 30
37 new SwissGrid(),
38 }));
39
40 public static ArrayList<Projection> getProjections() {
41 return allProjections;
42 }
43
44 /**
45 * Adds a new projection to the list of known projections.
46 *
47 * For Plugins authors: make sure your plugin is an early plugin, i.e. put
48 * Plugin-Early=true in your Manifest.
49 */
50 public static void addProjection(Projection proj) {
51 allProjections.add(proj);
52 }
53
54 static public EastNorth project(LatLon ll) {
55 if (ll == null) return null;
56 return Main.getProjection().latlon2eastNorth(ll);
57 }
58
59 static public LatLon inverseProject(EastNorth en) {
60 if (en == null) return null;
61 return Main.getProjection().eastNorth2latlon(en);
62 }
63}
Note: See TracBrowser for help on using the repository browser.